Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Duncan Gillis <dgillis(at)dystillr(dot)com>
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Date: 2014-07-21 22:56:01
Message-ID: 27890.1405983361@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Duncan Gillis <dgillis(at)dystillr(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-07-21 23:01:08 Re: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Previous Message David G Johnston 2014-07-21 21:15:49 Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.