Seems to me there's a bug in HEAD (and probably old branches
as well) when compiled with HAVE_INT64_TIMESTAMP. As shown below
It sometimes shows things like "-6.-70 secs" where 8.3
showed "-6.70 secs".
I think the attached one-liner patch fixes this, as well as
another roundoff regression between HEAD and 8.3.
Ron Mayer
================================================================================
== ON HEAD
================================================================================
regression=# set datestyle to sql;
SET
regression=# select '-10 mons -3 days +03:55:06.70'::interval;
interval
----------------------------------------------------
@ 10 mons 3 days -3 hours -55 mins -6.-70 secs ago
(1 row)
regression=# select '1 year 2 mons 3 days 04:05:06.699999'::interval;
interval
-------------------------------------------------
@ 1 year 2 mons 3 days 4 hours 5 mins 6.69 secs
(1 row)
================================================================================
== ON 8.3
================================================================================
pg83=# set datestyle to sql;
SET
pg83=# select '-10 mons -3 days +03:55:06.70'::interval;
interval
---------------------------------------------------
@ 10 mons 3 days -3 hours -55 mins -6.70 secs ago
(1 row)
pg83=# select '1 year 2 mons 3 days 04:05:06.699999'::interval;
interval
-------------------------------------------------
@ 1 year 2 mons 3 days 4 hours 5 mins 6.70 secs
(1 row)
Attachment: bugs.patch
Description: text/x-diff (596 bytes)
Responses
pgsql-hackers by date
| Next: | From: Ron Mayer | Date: 2008-10-02 10:01:00 |
| Subject: Re: Patch for SQL-Standard Interval output and decoupling DateStyle
from IntervalStyle |
| Previous: | From: Richard Huxton | Date: 2008-10-02 09:53:17 |
| Subject: Re: Transactions within a function body |