Re: IANA timezone abbreviations versus timezone_abbreviations

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 12:22:24
Message-ID: D6P15EVTRJBG.3LVQVVTCZMGKC@jeltef.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun Dec 29, 2024 at 11:56 PM CET, Tom Lane wrote:
> Hmm, I don't like your phrasing using "IANA time zone database",
> because that makes it sound like we'll take any abbreviation that's
> found anywhere in that whole data set. What the proposal actually
> does is to recognize any abbreviation that is used, or has been
> used in the past, in the IANA time zone selected by our current
> timezone setting. (And, perhaps more to the point, to give it the
> meaning it has or had in that zone.) Not sure about concise wording
> for that.

Okay, yeah I definitely misunderstood what was happening here. So
scratch my previous attempt at clarifying.

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.

I definitely think this is a step in the right direction, but I'm not
sure that it goes far enough. How about in addition we change the
following:

1. Change the default of timezone_abbreviations to an empty list.
2. When parsing search for the abbreviation string in the IANA timezone
database.
a. If it's a unique match, use that timezone.
b. If it's not unique, but it matches an abbreviation of the current
timezone, use that timezone.
c. If it's part of the timezone_abbreviations list, use that timezone.
d. Else, throw an error.

I think that would result in a lot more sensible behaviour.

Another option would be to put "c" at the top of the list, which would
allow overriding the IANA timezone database with that file. As long as
we don't do that by default I think that would be fine.

And I guess a third option would be to remove conflicts from the Default
timezone_abbreviations list.

To be clear, for backwards compatibility we should probably keep the old
Default list in any of these cases so people can easily switch back in
case this change breaks their application.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-12-30 12:29:36 Re: Support regular expressions with nondeterministic collations
Previous Message Jelte Fennema-Nio 2024-12-30 11:03:19 Re: IANA timezone abbreviations versus timezone_abbreviations