Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cW53L-0006l2-Ct for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Jan 2017 17:38:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cW53K-0002TA-Sx for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Jan 2017 17:38:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW53K-0002R8-44 for pgsql-bugs@postgresql.org; Tue, 24 Jan 2017 17:38:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW53H-0004SU-5B for pgsql-bugs@postgresql.org; Tue, 24 Jan 2017 17:38:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0OHcaBZ022549; Tue, 24 Jan 2017 12:38:36 -0500 From: Tom Lane To: adrian.klaver@aklaver.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14511: Set timezone to local In-reply-to: <20170124161332.1431.51405@wrigleys.postgresql.org> References: <20170124161332.1431.51405@wrigleys.postgresql.org> Comments: In-reply-to adrian.klaver@aklaver.com message dated "Tue, 24 Jan 2017 16:13:32 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22547.1485279516.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 24 Jan 2017 12:38:36 -0500 Message-ID: <22548.1485279516@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org adrian.klaver@aklaver.com writes: > test=3D> set timezone =3D DEFAULT; > SET > test=3D> set timezone =3D LOCAL; > ERROR: invalid value for parameter "TimeZone": "local" > test=3D> 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 =3D 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 | =3D } { value | 'val= ue' | DEFAULT } SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT } LOCAL is not listed as a valid alternative for the first syntax. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs