From 583736fad40e06c3ed65d80ae3ebb5128d10ad94 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 16 May 2003 13:57:03 +0000 Subject: [PATCH] Back-patch fix from Oliver Elphick to force ISO datestyle in dumps. --- src/bin/pg_dump/pg_dump.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) -- 2.39.5