From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Date: Mon, 21 Jul 2014 23:27:44 -0400
Message-ID: <5100.1405999664@sss.pgh.pa.us> (raw)
In-Reply-To: <1405987796684-5812301.post@n5.nabble.com>
References: <20140721194918.27765.11913@wrigleys.postgresql.org>
<24902.1405974941@sss.pgh.pa.us>
<1405977349153-5812283.post@n5.nabble.com>
<28029.1405983668@sss.pgh.pa.us>
<CAKFQuwa3LtgAqjP8=3NS0vb_sBqX2pWeXn7Yopc1izSN5Rv9RA@mail.gmail.com>
<1405987796684-5812301.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
David G Johnston <david.g.johnston@gmail.com> writes:
> Though pondering this additionally the actual coding to make -0400 be
> interpreted as "-4:00" would indeed be a feature enhancement - though
> accepting a result of 400 I would argue is a bug even if it is one we are
> going to choose to live with in back branches for compatibility reasons. We
> seem to already agree that it should at least error out on a going-forward
> basis.
The fact that it crashes is indisputably a bug (fixed as of a few minutes
ago). However, whether SET TIMEZONE = '-0400' should be read as setting
the UTC offset to 400 hours, or 400 minutes, or 400 seconds, or 4 hours,
or who knows what else, is not a bug, it's a definitional disagreement.
As a comparison point, the syntax SET TIME ZONE INTERVAL '-0400' is
specified in the SQL standard, and unless I'm totally misreading it, the
standard requires that to be interpreted as 400 minutes. (The standard's
examples of useful values look more like '-04:00'.) Now that might look
silly on its face, but if the string is '-180' then reading it as UTC
minus 3 hours doesn't seem so silly.
Anyway, we could certainly have a discussion about changing the
interpretation, but it would not be a back-patchable bug fix IMO.
There's a non-negligible risk of breaking apps that worked before.
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
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, david.g.johnston@gmail.com
Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
In-Reply-To: <5100.1405999664@sss.pgh.pa.us>
References: <20140721194918.27765.11913@wrigleys.postgresql.org> <24902.1405974941@sss.pgh.pa.us> <1405977349153-5812283.post@n5.nabble.com> <28029.1405983668@sss.pgh.pa.us> <CAKFQuwa3LtgAqjP8=3NS0vb_sBqX2pWeXn7Yopc1izSN5Rv9RA@mail.gmail.com> <1405987796684-5812301.post@n5.nabble.com> <5100.1405999664@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