Re: [BUG?] SET TIME ZONE doesn't work with abbreviations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUG?] SET TIME ZONE doesn't work with abbreviations
Date
Msg-id 3169525.1631023209@sss.pgh.pa.us
Whole thread Raw
In response to [BUG?] SET TIME ZONE doesn't work with abbreviations  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: [BUG?] SET TIME ZONE doesn't work with abbreviations
List pgsql-hackers
Aleksander Alekseev <aleksander@timescale.com> writes:
> I noticed that `SET TIME ZONE` / `SET timezone TO` don't work with
> abbreviations:

That's intentional, per the fine manual:

        A time zone abbreviation, for example <literal>PST</literal>.  Such a
        specification merely defines a particular offset from UTC, in
        contrast to full time zone names which can imply a set of daylight
        savings transition rules as well.  The recognized abbreviations
        are listed in the <literal>pg_timezone_abbrevs</literal> view (see <xref
        linkend="view-pg-timezone-abbrevs"/>).  You cannot set the
        configuration parameters <xref linkend="guc-timezone"/> or
        <xref linkend="guc-log-timezone"/> to a time
        zone abbreviation, but you can use abbreviations in
        date/time input values and with the <literal>AT TIME ZONE</literal>
        operator.

I'm too caffeine-deprived to remember the exact reasoning right now,
but it was likely along the lines of "you don't really want to do
that because it won't track DST changes".

            regards, tom lane



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [BUG?] SET TIME ZONE doesn't work with abbreviations
Next
From: Tom Lane
Date:
Subject: Re: Data loss when '"json_populate_recorset" with long column name