Re: [BUG?] SET TIME ZONE doesn't work with abbreviations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG?] SET TIME ZONE doesn't work with abbreviations
Date: 2021-09-07 14:00:09
Message-ID: 3169525.1631023209@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aleksander Alekseev <aleksander(at)timescale(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-09-07 14:08:30 Re: Data loss when '"json_populate_recorset" with long column name
Previous Message David G. Johnston 2021-09-07 13:57:41 Re: [BUG?] SET TIME ZONE doesn't work with abbreviations