Re: to_char(OF) is broken

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: to_char(OF) is broken
Date: 2016-03-17 19:06:41
Message-ID: 22320.1458241601@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> On Thu, Mar 17, 2016 at 3:23 PM, Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
>> On Thu, Mar 17, 2016 at 3:02 AM, David Fetter <david(at)fetter(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message cpacejo 2016-03-17 21:05:40 BUG #14030: BRIN doc bug
Previous Message robf.42 2016-03-17 17:39:56 BUG #14029: PgAdmin III truncates reverse engineered SQL script for a materialized vw if contains a semicolon