Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf4cee1

Browse files
committed
At present, dates are put into a dump in the format specified by the
default datestyle. This is not portable between installations.This patch sets DATESTYLE to ISO at the start of a pg_dump, so that thedates written into the dump will be restorable onto any database,regardless of how its default datestyle is set.Oliver Elphick
1 parent5f65225 commitcf4cee1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.321 2003/03/2006:26:30 momjian Exp $
15+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.322 2003/03/2007:05:21 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -548,6 +548,13 @@ main(int argc, char **argv)
548548
PQerrorMessage(g_conn));
549549
PQclear(res);
550550

551+
/* Set the datestyle to ISO to ensure the dump's portability */
552+
res=PQexec(g_conn,"SET DATESTYLE = ISO");
553+
if (!res||PQresultStatus(res)!=PGRES_COMMAND_OK)
554+
exit_horribly(g_fout,NULL,"could not set datestyle to ISO: %s",
555+
PQerrorMessage(g_conn));
556+
PQclear(res);
557+
551558
/*
552559
* If supported, set extra_float_digits so that we can dump float data
553560
* exactly (given correctly implemented float I/O code, anyway)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp