From: Tom Lane <tgl@sss.pgh.pa.us>
To: adrian.klaver@aklaver.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14511: Set timezone to local
Date: Tue, 24 Jan 2017 12:38:36 -0500
Message-ID: <22548.1485279516@sss.pgh.pa.us> (raw)
In-Reply-To: <20170124161332.1431.51405@wrigleys.postgresql.org>
References: <20170124161332.1431.51405@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
adrian.klaver@aklaver.com writes:
> test=> set timezone = DEFAULT;
> SET
> test=> set timezone = LOCAL;
> ERROR: invalid value for parameter "TimeZone": "local"
> test=> set time zone LOCAL;
> SET
"SET TIME ZONE LOCAL" is a SQL-standard-mandated variant way of writing
"set timezone to default", following the SQL committee's time-honored
principle of never using orthogonal syntax if somebody can think of an
idiosyncratic way instead.
Given the way that our grammar is set up, the only way we could handle
"set timezone = LOCAL" would be to allow LOCAL as a synonym for DEFAULT
for *all* SET variables. That doesn't seem like a particularly good
idea.
> The docs:
> https://www.postgresql.org/docs/9.5/static/sql-set.html
> say the last two commands should yield the same result.
AFAICS, the docs show the syntax restriction accurately:
SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT }
SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
LOCAL is not listed as a valid alternative for the first syntax.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com
Subject: Re: BUG #14511: Set timezone to local
In-Reply-To: <22548.1485279516@sss.pgh.pa.us>
References: <20170124161332.1431.51405@wrigleys.postgresql.org> <22548.1485279516@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox