]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Back-patch fix from Oliver Elphick to force ISO datestyle in dumps.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 May 2003 13:57:03 +0000 (13:57 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 May 2003 13:57:03 +0000 (13:57 +0000)
src/bin/pg_dump/pg_dump.c

index 183d8e6ff30940560be92c1c560370e5addc89e9..831c22b419bc7767a6facdbe09291ffeb67ed553 100644 (file)
@@ -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)