aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-04-21 13:46:20 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-04-21 13:46:20 -0400
commitce1c30eceb57ccb8ede96565c252bb6f41b6d4e1 (patch)
tree76838354fe15ae5ea2123b860a1b30c1bfdc86f6
parent74a587a009d134a92dea12f1971cca9165ae0a26 (diff)
downloadpostgresql-ce1c30eceb57ccb8ede96565c252bb6f41b6d4e1.tar.gz
postgresql-ce1c30eceb57ccb8ede96565c252bb6f41b6d4e1.zip
Make postgres_fdw request remote time zone 'GMT' not 'UTC'.
This should have the same results for all practical purposes. The advantage of selecting 'GMT' is that it's guaranteed to work even when the remote system's timezone database is missing entries, because pg_tzset() hard-wires handling of that, at least in 9.2 and later. (It seems like it would be a good idea to similarly hard-wire correct handling of 'UTC', but that'll be a little more invasive than I want to consider back-patching. Leave that for another day when we're not in feature freeze.) Per trouble report from Adnan Dautovic. Back-patch to all supported branches. Discussion: https://postgr.es/m/465248.1712211585@sss.pgh.pa.us
-rw-r--r--contrib/postgres_fdw/connection.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index f36871da9ad..567c0b5bb6c 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -368,10 +368,12 @@ configure_remote_session(PGconn *conn)
* anyway. However it makes the regression test outputs more predictable.
*
* We don't risk setting remote zone equal to ours, since the remote
- * server might use a different timezone database. Instead, use UTC
- * (quoted, because very old servers are picky about case).
+ * server might use a different timezone database. Instead, use GMT
+ * (quoted, because very old servers are picky about case). That's
+ * guaranteed to work regardless of the remote's timezone database,
+ * because pg_tzset() hard-wires it (at least in PG 9.2 and later).
*/
- do_sql_command(conn, "SET timezone = 'UTC'");
+ do_sql_command(conn, "SET timezone = 'GMT'");
/*
* Set values needed to ensure unambiguous data output from remote. (This