Re: IANA timezone abbreviations versus timezone_abbreviations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "Andreas Karlsson" <andreas(at)proxel(dot)se>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: IANA timezone abbreviations versus timezone_abbreviations
Date: 2024-12-30 16:33:39
Message-ID: 3860815.1735576419@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl> writes:
> The current situation seems utterly messed up though. One thing that
> shocks me is that we're, by default and without warning, parsing IST as
> Israel Standard Time instead of the timezone that 17% of the world's
> population uses: Indian Standard Time. And even with this patch that
> behaviour only changes if you set your timezone to Asia/India. Which
> seems suboptimal, because even as a European myself, IST means Indian
> Standard Time.

This argument would hold more water if we'd gotten more than
approximately zero field complaints about the current setup.
I think most folk who want that just use the documented solution
of setting timezone_abbreviations = 'India'.

Certainly there's an argument to be made that we should have gone
for a minimal rather than maximal default list of abbreviations.
But it's a couple of decades too late to be making that argument ---
at this point backwards compatibility is a huge consideration IMV.
(The current design dates from d8b5c95ca of 2006-07-25, just to
clarify how long this has stood.)

> 1. Change the default of timezone_abbreviations to an empty list.

The villagers would be on our doorstep with pitchforks if we did
that. It's remarkable how many of these abbreviations have live
constituencies --- try searching the commit log for "abbreviation"
to find a lot of commits that added zone abbrevs based on user
complaints. Now, most of those complaints were ten or more years
back, so maybe people no longer care as much ... but I doubt that's
the way to bet.

> 2. When parsing search for the abbreviation string in the IANA timezone
> database.

Searching the whole IANA database isn't very practical I fear.
We do something approximately that costly to identify the default
timezone setting --- and that is code that got moved into initdb
precisely because it was too slow to be tolerable as part of
postmaster start. It might work to calculate the set of abbrevs
known in the IANA data once and cache it; but where, and how
would we know when to update the cache?

Another thing that complicates all this is that our
timezone_abbreviations data reflects a very old state of the IANA
database, from when they were of a mindset that every zone should have
alphabetic timezone abbrevs even if they had to make them up. A few
of those choices achieved real-world currency, but most didn't, and
starting in about 2015 the IANA crew removed (most of?) the ones
they'd made up in favor of numerical UTC offsets. We kept them all,
for fear of user complaints if we removed them. So we're now in a
situation where timezone_abbreviations knows a lot of abbrevs that
are no longer to be found in IANA, and it's very unclear how many
people might be depending on those entries. It's probably more than
none though. (Conversely, IANA does still have some historical
abbrevs such as "LMT" that aren't in timezone_abbreviations.)

Anyway, I'm of the opinion that we should be after a minimal change
not a grand rewrite that removes all ambiguity. Timezones are such
a political mess that we probably couldn't reach 100% clarity anyway.
We could definitely do major damage to the system's usability
though, if we don't tread carefully.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2024-12-30 16:37:14 Re: Proposal: Progressive explain
Previous Message Bruce Momjian 2024-12-30 16:19:47 Re: RFC: Allow EXPLAIN to Output Page Fault Information