Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cW5CY-0007Pc-A8 for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Jan 2017 17:48:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cW5CX-0002NB-TL for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Jan 2017 17:48:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW5CX-0002MW-0b for pgsql-bugs@postgresql.org; Tue, 24 Jan 2017 17:48:13 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW5CS-0006Gj-US for pgsql-bugs@postgresql.org; Tue, 24 Jan 2017 17:48:12 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A25C5208AE; Tue, 24 Jan 2017 12:48:07 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Tue, 24 Jan 2017 12:48:07 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=yX0FUAkcNzuJtyT Aw2Hq7RqLQL4=; b=JSi2auo2r0+drG3a+y6MuhTsq1XA50exOvRTdaUrGMpfYKG mxn5JsX4cLL17RVMFqx6L6FabvDln9DsyidQdOBQXqYs9LfZjI89dyvKqaZvWUxJ SKFAT3jd8+EJGNFqNHsPMGcpjTCip2b0dhntCOtIiS6boojum+V8RMoFO0l0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=yX0FUAkcNzuJtyTAw2Hq7RqLQL4=; b=ST0MsLOGjuiYgrqjkq9Y REettoOUdFdhmFqppwGKA6tEzIplBmgdtHkLVWn6umKDFjWX9vlcalgQxUqpCenp ooRcmy/BIO7JtM23c/1QXqolCGmAOMzEgjDCMtr+Ajj6EUwVCZQgdPhP4L2oZd5T YQ/6pj+P7Zd/JgcxVGLAN/U= X-ME-Sender: X-Sasl-enc: IQbVFR7CvMKWl7wXZLYZwsy6WPoBh9HLfW6CX+NwOKdu 1485280087 Received: from [192.168.1.2] (174-21-203-58.tukw.qwest.net [174.21.203.58]) by mail.messagingengine.com (Postfix) with ESMTPA id 2111824066; Tue, 24 Jan 2017 12:48:07 -0500 (EST) Subject: Re: BUG #14511: Set timezone to local To: Tom Lane References: <20170124161332.1431.51405@wrigleys.postgresql.org> <22548.1485279516@sss.pgh.pa.us> Cc: pgsql-bugs@postgresql.org From: Adrian Klaver Message-ID: <68dae0c0-b0b9-d232-9e21-7d577ab3d6d7@aklaver.com> Date: Tue, 24 Jan 2017 09:48:06 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <22548.1485279516@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) 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 On 01/24/2017 09:38 AM, Tom Lane wrote: > 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. I did not crawl that far up the page, I stopped at: SET TIME ZONE value is an alias for SET timezone TO value. and assumed since LOCAL was valid for the one it was valid for the other. I should know better:( > > regards, tom lane > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs