]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix bogus timetz_zone() results for DYNTZ abbreviations.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 6 Sep 2021 15:29:52 +0000 (11:29 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 6 Sep 2021 15:29:52 +0000 (11:29 -0400)
commit5907c3818c43a1e0b946acc09df6dcbba42f621f
tree8d9fc862b9665a7b036644f1fd8845848eeecc83
parenta5e8f7b3798b6fb9a4f3129a5eab98b7087c8a80
Fix bogus timetz_zone() results for DYNTZ abbreviations.

timetz_zone() delivered completely wrong answers if the zone was
specified by a dynamic TZ abbreviation, because it failed to account
for the difference between the POSIX conventions for field values in
struct pg_tm and the conventions used in PG-specific datetime code.

As a stopgap fix, just adjust the tm_year and tm_mon fields to match
PG conventions.  This is fixed in a different way in HEAD (388e71af8)
but I don't want to back-patch the change of reference point.

Discussion: https://postgr.es/m/CAJ7c6TOMG8zSNEZtCn5SPe+cCk3Lfxb71ZaQwT2F4T7PJ_t=KA@mail.gmail.com
src/backend/utils/adt/date.c