pgsql: Fix bogus timetz_zone() results for DYNTZ abbreviations.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix bogus timetz_zone() results for DYNTZ abbreviations.
Date: 2021-09-06 15:30:15
Message-ID: E1mNGZb-0002km-12@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/eb3c8d24808a4d3ee8a257f4b856d5583b5cfdaa

Modified Files
--------------
src/backend/utils/adt/date.c | 2 ++
1 file changed, 2 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-09-06 15:43:50 pgsql: Fix actively-misleading comments about the contents of struct pg
Previous Message Tom Lane 2021-09-06 15:04:07 pgsql: Make timetz_zone() stable, and correct a bug for DYNTZ abbreviat