Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9MVX-0004cg-Ba for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Jul 2014 22:56:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9MVW-00039h-3K for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Jul 2014 22:56:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9MVV-00039a-5D for pgsql-bugs@postgreSQL.org; Mon, 21 Jul 2014 22:56:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9MVN-0006f9-1Q for pgsql-bugs@postgreSQL.org; Mon, 21 Jul 2014 22:56:31 +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 s6LMu1qZ027891; Mon, 21 Jul 2014 18:56:01 -0400 From: Tom Lane To: Duncan Gillis cc: pgsql-bugs@postgreSQL.org Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone. In-reply-to: <53CD87E2.8000106@dystillr.com> References: <20140721194918.27765.11913@wrigleys.postgresql.org> <24902.1405974941@sss.pgh.pa.us> <53CD87E2.8000106@dystillr.com> Comments: In-reply-to Duncan Gillis message dated "Mon, 21 Jul 2014 18:36:34 -0300" Date: Mon, 21 Jul 2014 18:56:01 -0400 Message-ID: <27890.1405983361@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Duncan Gillis writes: > I didn't intend on such an absurd timezone. The "-0400" came from a > shell script of mine that set the timezone to an offset using using > Unix's date command to print the local timezone offset (e.g., date +%z > #=> -0400, if you're on the US east coast). Ah so. > The "+/-HHMM" timezone offset format -- without the colon between hours > and minutes -- is quite common so it seems like this would be an easy > error to make. Since a lot of developers interact with the database > primarily through an ORM and as many (most?) ORMs apply their own > localization conversion to a timestamp received from the database, a lot > of people could have made a mistake similar to mine and never seen any > ill effects. Then, all of a sudden 9.4 would appear to break their > application. Well, as I said, previous releases would have interpreted that as UTC minus about two and a half weeks, so I'm not sure what you consider an "ill effect" ;-). Accepting a plausible-looking setting and then interpreting it in a totally insane way isn't that helpful IMO. But I think we can content ourselves with throwing an error here, rather than trying to restore the previous range of accepted values. If we make it complain specifically that the UTC offset is out of range, it might help people spot the problem pretty easily. 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