aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/spgist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-11-01 12:13:23 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2013-11-01 12:13:23 -0400
commit2650c5cf4beb727e739f71a77369b01bf6daaf60 (patch)
treeac0b6ceaa3d113437bb81764d2ceec2678c2f937 /src/backend/access/spgist
parent27deb0480c9a9b437d6e77685c45d9ced09ba1ec (diff)
downloadpostgresql-2650c5cf4beb727e739f71a77369b01bf6daaf60.tar.gz
postgresql-2650c5cf4beb727e739f71a77369b01bf6daaf60.zip
Fix some odd behaviors when using a SQL-style simple GMT offset timezone.
Formerly, when using a SQL-spec timezone setting with a fixed GMT offset (called a "brute force" timezone in the code), the session_timezone variable was not updated to match the nominal timezone; rather, all code was expected to ignore session_timezone if HasCTZSet was true. This is of course obviously fragile, though a search of the code finds only timeofday() failing to honor the rule. A bigger problem was that DetermineTimeZoneOffset() supposed that if its pg_tz parameter was pointer-equal to session_timezone, then HasCTZSet should override the parameter. This would cause datetime input containing an explicit zone name to be treated as referencing the brute-force zone instead, if the zone name happened to match the session timezone that had prevailed before installing the brute-force zone setting (as reported in bug #8572). The same malady could affect AT TIME ZONE operators. To fix, set up session_timezone so that it matches the brute-force zone specification, which we can do using the POSIX timezone definition syntax "<abbrev>offset", and get rid of the bogus lookaside check in DetermineTimeZoneOffset(). Aside from fixing the erroneous behavior in datetime parsing and AT TIME ZONE, this will cause the timeofday() function to print its result in the user-requested time zone rather than some previously-set zone. It might also affect results in third-party extensions, if there are any that make use of session_timezone without considering HasCTZSet, but in all cases the new behavior should be saner than before. Back-patch to all supported branches.
Diffstat (limited to 'src/backend/access/spgist')
0 files changed, 0 insertions, 0 deletions