Skip to content

Commit 17edb84

Browse files
committed
Seems we had the wrong sign convention for the default Etc/GMTx zone
names. Per report from Alvaro.
1 parent 9e0fcc2 commit 17edb84

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/timezone/pgtz.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.12 2004/05/23 22:24:08 tgl Exp $
9+
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.13 2004/05/23 23:26:53 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -219,9 +219,14 @@ identify_system_timezone(void)
219219
if (try_timezone(__tzbuf, &tt, dst_found))
220220
return __tzbuf;
221221

222-
/* Did not find the timezone. Fallback to try a GMT zone. */
222+
/*
223+
* Did not find the timezone. Fallback to try a GMT zone. Note that the
224+
* zic timezone database names the GMT-offset zones in POSIX style: plus
225+
* is west of Greenwich. It's unfortunate that this is opposite of SQL
226+
* conventions. Should we therefore change the names? Probably not...
227+
*/
223228
sprintf(__tzbuf, "Etc/GMT%s%d",
224-
(-tt.std_ofs < 0) ? "+" : "", tt.std_ofs / 3600);
229+
(-tt.std_ofs > 0) ? "+" : "", -tt.std_ofs / 3600);
225230
ereport(LOG,
226231
(errmsg("could not recognize system timezone, defaulting to \"%s\"",
227232
__tzbuf),

0 commit comments

Comments
 (0)