pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Duncan Gillis <dgillis@dystillr.com>
Cc: pgsql-bugs@postgreSQL.org
Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Date: Mon, 21 Jul 2014 18:56:01 -0400
Message-ID: <27890.1405983361@sss.pgh.pa.us> (raw)
In-Reply-To: <53CD87E2.8000106@dystillr.com>
References: <20140721194918.27765.11913@wrigleys.postgresql.org>
	<24902.1405974941@sss.pgh.pa.us>
	<53CD87E2.8000106@dystillr.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Duncan Gillis <dgillis@dystillr.com> 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



view thread (9+ messages)  latest in thread

Message-ID: <27890.1405983361@sss.pgh.pa.us>
Permalink:  ../27890.1405983361@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27890.1405983361@sss.pgh.pa.us

 · 

reply

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, dgillis@dystillr.com
  Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
  In-Reply-To: <27890.1405983361@sss.pgh.pa.us>
  References: <20140721194918.27765.11913@wrigleys.postgresql.org> <24902.1405974941@sss.pgh.pa.us> <53CD87E2.8000106@dystillr.com> <27890.1405983361@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