]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix AT TIME ZONE (in all three variants) so that we first try to interpret
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 18:09:53 +0000 (18:09 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 7 Jul 2008 18:09:53 +0000 (18:09 +0000)
commit75c2e394328311d1cf8821d9684eed6df2d5c4fa
treed0ff98d5dc94095b957897466f7f523b979ae43e
parentb1f3b687965902dfb68f894a35b9c13996c209e0
Fix AT TIME ZONE (in all three variants) so that we first try to interpret
the timezone argument as a timezone abbreviation, and only try it as a full
timezone name if that fails.  The zic database has four zones (CET, EET, MET,
WET) that are full daylight-savings zones and yet have names that are the
same as their abbreviations for standard time, resulting in ambiguity.
In the timestamp input functions we resolve the ambiguity by preferring the
abbreviation, and AT TIME ZONE should work the same way.  (No functionality
is lost because the zic database also has other names for these zones, eg
Europe/Zurich.)  Per gripe from Jaromir Talir.

Backpatch to 8.1.  Older releases did not have the issue because AT TIME ZONE
only accepted abbreviations not zone names.  (Thus, this patch also arguably
fixes a compatibility botch introduced at 8.1: in ambiguous cases we now
behave the same as 8.0 did.)
src/backend/utils/adt/date.c
src/backend/utils/adt/timestamp.c