pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: David Fetter <david@fetter.org>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: to_char(OF) is broken
Date: Thu, 17 Mar 2016 15:06:41 -0400
Message-ID: <22320.1458241601@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEepm=2qtgGwMqJN8yZo572J3_rr1oWGYsCzOYj0-cB6=QHZnw@mail.gmail.com>
References: <20160316140238.GA9113@fetter.org>
	<CAEepm=2PE=UKa2RMTyoMBZ7dB+93v=9YyoBqHzUKZu6jt5czeA@mail.gmail.com>
	<CAEepm=2qtgGwMqJN8yZo572J3_rr1oWGYsCzOYj0-cB6=QHZnw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Thomas Munro <thomas.munro@enterprisedb.com> writes:
> On Thu, Mar 17, 2016 at 3:23 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> On Thu, Mar 17, 2016 at 3:02 AM, David Fetter <david@fetter.org> wrote:
>>> Fractional offset time zones should probably be in our regression test
>>> suite for this feature.

>> It looks like 2d87eedc made adjustments in accounting for padding
>> negative numbers in several places, but the case of OF is different
>> than the other places because it also has a sign for positive numbers,
>> so no adjustment was necessary there.  See attached.

> ... and 9.4 has a different bug as you showed (missing abs).  Here's a
> patch for 9.4 that uses the same code as master for that switch case
> (and adds the same regression test).

> 9.5 doesn't have either of the bugs, but might as well have the same
> regression test just to show that.

This is still not quite right, as it would do the wrong thing for a
zone '-00:30'.  I'm not sure that such a zone exists in reality,
but we might as well get it right.

Will fix and commit.  Thanks for looking at this!

			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 (4+ messages)

Message-ID: <22320.1458241601@sss.pgh.pa.us>
Permalink:  ../22320.1458241601@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22320.1458241601@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, thomas.munro@enterprisedb.com, david@fetter.org
  Subject: Re: to_char(OF) is broken
  In-Reply-To: <22320.1458241601@sss.pgh.pa.us>
  References: <20160316140238.GA9113@fetter.org> <CAEepm=2PE=UKa2RMTyoMBZ7dB+93v=9YyoBqHzUKZu6jt5czeA@mail.gmail.com> <CAEepm=2qtgGwMqJN8yZo572J3_rr1oWGYsCzOYj0-cB6=QHZnw@mail.gmail.com> <22320.1458241601@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