Re: The contents of the pg_timezone_names view bring some surprises

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>, Tom Lane PostgreSQL <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: The contents of the pg_timezone_names view bring some surprises
Date: 2021-05-21 15:25:53
Message-ID: 9d85b592-b79f-06b9-75d3-45ea4451522c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/19/21 5:50 PM, Bryn Llewellyn wrote:

> Thanks, as ever, David and Tom, for your quick responses. Thanks also to
> Adrian Klaver, who replied in a branched thread with this—in response to
> my comment about my reading of the information content of the
> pg_timezone_abbrevs view: « This claims (as I read it) that a time zone
> abbreviation uniquely determines an offset from UTC. »
>

>
> *Secondly, Adrians's response.*
>
> Yes, the point that a timezone abbreviation does not uniquely determine
> the timezone offset is taken now. But notice this:
>
> « In short, this is the difference between abbreviations and full names:
> abbreviations represent a specific offset from UTC…»
> from
>
> "8.5.3. Time Zones"
> https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES
> <https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES>
>
> This seems to me to be flat-out wrong. An abbreviation, in general, does
> not represent a specific offset from UTC. Rather, it can represent two
> or more different offsets.

It is not flat out wrong. An abbreviation, say the one I'm in now PDT,
will only represent a specific offset(-07), whereas the timezone I'm in,
America/Los_Angeles, represents two offsets(-08/-07) the value of which
depends on the date. Now there maybe another abbreviation that uses that
same offset, but again it only represents a single offset.

> Nonsense, eh? As David said, it's an instance of the more general:
>
> set timezone = 'Foo42Bar';
> show timezone;
>
> I wish there was a way to turn this off and accept only
> pg_timestamp_names.name values.
>
> The second reason is that the abbreviations confuse ordinary readers who
> are slow to remember the "up is down" story.
>

The issue is you are looking for logic in a system that is based on
political decisions. For instance there is a brewing West Coast
movement, whereby the states on the US West Coast are looking to drop
the DST transition with or without the approval of Congress. COVID
stalled it, but I expect it will appear again in the near future.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stacey Haysler 2021-05-21 16:58:12 Proposed Chinese Translation of Community Code of Conduct
Previous Message Peter J. Holzer 2021-05-21 15:17:52 Re: Question about integer out of range in function