Re: Patch for ISO-8601-Interval Input and output. - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: Patch for ISO-8601-Interval Input and output.
Date
Msg-id 49145C8B.8080009@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Patch for ISO-8601-Interval Input and output.  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: Patch for ISO-8601-Interval Input and output.
List pgsql-hackers
Brendan Jurd wrote:
> On Fri, Nov 7, 2008 at 3:35 AM, Ron Mayer <rm_pg@cheapcomplexdevices.com> wrote:
>> I think I updated the web site and git now, and
>> 'P0000-00-01' is now accepted.   It might be useful if
>> someone double checked my reading of the spec, tho.
> 
> I've tested out your latest revision and read the spec more closely,
> and pretty much everything works as expected. ...
> I agree with your interpretation of the spec, it clearly says that 'T'
> can be omitted when there are no time components. ...
> The examples in Annex B confirm this.

Cool.  Thanks.

> I did run into one potential bug:
> postgres=# select interval 'P0001';
>  ...
> Whereas, I expected to get '1 year', since the format allows you to
> omit lower-order components from right-to-left:
> P0001-01-01 => 1 year 1 month 1 day
> P0001-01 => 1 year 1 month
> P0001 => should be 1 year?

Indeed, that's right.   Thanks for catching another one.
I just checked in (to my git) a patch that I believe fixes it.

regression=# select interval 'P0001',interval 'P00010000',interval 'PT01'; interval | interval | interval
----------+----------+---------- 1 year   | 1 year   | 01:00:00
(1 row)

> On the documentation front, I have a few final cleanups to suggest
> (patch attached).
>  * After giving the spec a closer look, I thought that 4.4.3.2 and
> 4.4.3.3 were the proper spec references to use for the two formats.

Hmmm... Certainly what I had in datatype.sgml was wrong, but I'm
now thinking 5.5.4.2.1 and 5.5.4.2.2 would be the most clear?

Totally agree with the rest of your docs changes and applied those.


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: Patch for ALTER DATABASE WITH TABLESPACE
Next
From: Simon Riggs
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1197)