Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9Neh-0008AL-9e for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Jul 2014 00:10:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9Neg-0007Gq-Pu for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Jul 2014 00:10:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9Nef-0007Gf-Mq for pgsql-bugs@postgresql.org; Tue, 22 Jul 2014 00:10:05 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X9NeY-0002dY-2e for pgsql-bugs@postgresql.org; Tue, 22 Jul 2014 00:10:03 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1X9NeW-0006Lk-MH for pgsql-bugs@postgresql.org; Mon, 21 Jul 2014 17:09:56 -0700 Date: Mon, 21 Jul 2014 17:09:56 -0700 (PDT) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1405987796684-5812301.post@n5.nabble.com> In-Reply-To: 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> Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 0.8 (/) 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 David G Johnston wrote > On Mon, Jul 21, 2014 at 4:01 PM, Tom Lane < > tgl@.pa > > wrote: >=20 >> David G Johnston < > david.g.johnston@ > > writes: >> > This does seem kind of a harsh for a mis-understanding that one cannot >> > specify a hours offset as a valid timezone identifier. ISTM the OP was >> > trying to set the timezone to EDT by specifying a -04 hours and 00 >> minutes >> > offset (- 04 00 =3D -0400 )...a 4-digit input like this shouldn't be >> > considered a -400 hour GMT offset... >> >> Perhaps so, but that's not the way it's been read by past PG releases. >> Changing that would be in the nature of a feature addition, not a bug >> fix, >> IMO. (In other words, if someone wants to do it, send in a patch ...) >> >> > =E2=80=8BAs you noted throwing an error is correct since an offset is not= a > timezone - at least not in a way that is deterministic. >=20 > Since I don't have any example usages that would be convincing proof that > interpreting -0400=E2=80=8B as 400 hours is a bug the point becomes moot.= In this > one instance neither 4 nor 400 is a reasonable answer. But given the > fundamental nature of a timezone anything that resolves to more than 12 > absolute hours is incorrectly coded since values outside of +/- [0, 12] > have no meaning and either should throw an error or, in this case, be > treated in a more logical manner (-4:00) >=20 > There is a bug somewhere though you are welcome to argue whose > responsibility it is to correct - or at least accept that the aberrant > behavior is now intentional and being kept for backward compatibility > reasons even if it can result in absurd results - no matter how > infrequent. >=20 > The code involved is already buggy since it crashes the server; this is > just another symptom that our current implementation is faulty. >=20 > David J. 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. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-1= 1014-Postgres-can-be-put-into-an-error-state-by-setting-invalid-timezone-tp= 5812271p5812301.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs