Re: Patch for ISO-8601-Interval Input and output.

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch for ISO-8601-Interval Input and output.
Date: 2008-11-07 15:19:39
Message-ID: 49145C8B.8080009@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Brendan Jurd wrote:
> On Fri, Nov 7, 2008 at 3:35 AM, Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-07 15:42:16 restore PD_PAGE_FULL on WAL update replay
Previous Message Bernd Helmle 2008-11-07 14:44:04 Re: Patch for ALTER DATABASE WITH TABLESPACE