From: Tom Lane Date: Fri, 16 May 2003 13:57:03 +0000 (+0000) Subject: Back-patch fix from Oliver Elphick to force ISO datestyle in dumps. X-Git-Tag: REL7_3_3~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=583736fad40e06c3ed65d80ae3ebb5128d10ad94;p=thirdparty%2Fpostgresql.git Back-patch fix from Oliver Elphick to force ISO datestyle in dumps. --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 183d8e6ff30..831c22b419b 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -22,7 +22,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.5 2003/05/03 22:19:18 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.6 2003/05/16 13:57:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -563,6 +563,13 @@ main(int argc, char **argv) exit_horribly(g_fout, NULL, "could not set transaction isolation level to serializable: %s", PQerrorMessage(g_conn)); PQclear(res); + + /* Set the datestyle to ISO to ensure the dump's portability */ + res = PQexec(g_conn, "SET DATESTYLE = ISO"); + if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) + exit_horribly(g_fout, NULL, "could not set datestyle to ISO: %s", + PQerrorMessage(g_conn)); + PQclear(res); } if (g_fout->remoteVersion < 70300)