ISO 8601 Intervals

Lists: pgsql-hackers
From: "Larry Rosenman" <ler(at)lerctr(dot)org>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: ISO 8601 Intervals
Date: 2006-01-08 03:12:31
Message-ID: 000001c61401$5e086890$67c8a8c0@lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

All,
I was thinking of handling the TODO for ISO8601 Interval output.

Is http://archives.postgresql.org/pgsql-patches/2003-09/msg00121.php
still
the consensus? I.E. rip out the current pseudo-iso code, and replace it
with
genuine ISO8601 code?

I tried(!) to e-mail Ron Mayer, but got a bounce :(

Thanks,
LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler(at)lerctr(dot)org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3683 US


From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ISO 8601 Intervals
Date: 2006-01-09 11:45:40
Message-ID: E5FB8934-2388-40C1-9E31-B9973624E552@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Jan 8, 2006, at 12:12 , Larry Rosenman wrote:

> I was thinking of handling the TODO for ISO8601 Interval output.

Just to be clear, you're talking about the ISO8601 duration syntax
(PnYnMnDTnHnMnS), correct? (The SQL standard made the unfortunate
choice to call durations, i.e., lengths of time, intervals.)

Michael Glaesemann
grzm myrealbox com


From: "Larry Rosenman" <ler(at)lerctr(dot)org>
To: "'Michael Glaesemann'" <grzm(at)myrealbox(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ISO 8601 Intervals
Date: 2006-01-09 13:35:11
Message-ID: 000701c61521$83db28c0$68c8a8c0@lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Michael Glaesemann wrote:
> On Jan 8, 2006, at 12:12 , Larry Rosenman wrote:
>
>> I was thinking of handling the TODO for ISO8601 Interval output.
>
> Just to be clear, you're talking about the ISO8601 duration syntax
> (PnYnMnDTnHnMnS), correct? (The SQL standard made the unfortunate
> choice to call durations, i.e., lengths of time, intervals.)

Yes.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler(at)lerctr(dot)org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3683 US


From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Subject: Re: ISO 8601 Intervals
Date: 2006-01-09 15:15:44
Message-ID: 43C27E20.7080303@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Larry Rosenman wrote:
> Michael Glaesemann wrote:
>>On Jan 8, 2006, at 12:12 , Larry Rosenman wrote:
>>> I was thinking of handling the TODO for ISO8601 Interval output.
>>
>>Just to be clear, you're talking about the ISO8601 duration syntax
>>(PnYnMnDTnHnMnS), correct? (The SQL standard made the unfortunate
>>choice to call durations, i.e., lengths of time, intervals.)

Back in 2003 I submitted such a patch [1,1b] that resulted in a fair
amount of discussion including some still (AFAIK) open issues
about the naming of the datestyle settings to control it [2,3,4].

There was also some discussion of the range off ISO 8601 durations
to support (ISO 8601 Basic Format, ISO 8601 Alternative Format,
and ISO 8601 Extended Format (which is more human-readable)) [5].

Finally, there is a similar, but different syntax currently supported
by postgresql (where '1Y1M' means 1 year 1 minute, while ISO 'P1Y1M'
would mean 1 year 1 month) and Tom recommended ripping that code
out[7] and at one point said my patch was looking cleaner than
the exiting code [8]. My patch does not yet rip that out.

I still use the patch myself, but don't have it updated to CVS tip.
I'd be happy to do so if people want that as a starting point.

Ron

[1] http://archives.postgresql.org/pgsql-patches/2003-09/msg00103.php
[1b] http://archives.postgresql.org/pgsql-patches/2003-09/msg00286.php
[2] http://archives.postgresql.org/pgsql-patches/2003-09/msg00122.php
[3] http://archives.postgresql.org/pgsql-patches/2003-09/msg00129.php
[4] http://archives.postgresql.org/pgsql-patches/2003-09/msg00130.php
[5] http://archives.postgresql.org/pgsql-patches/2003-09/msg00133.php
[6] http://archives.postgresql.org/pgsql-patches/2003-09/msg00134.php
[7] http://archives.postgresql.org/pgsql-patches/2003-09/msg00134.php

[8] http://archives.postgresql.org/pgsql-patches/2003-09/msg00121.php


From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Larry Rosenman <ler(at)lerctr(dot)org>
Subject: Re: ISO 8601 Intervals
Date: 2006-01-09 15:25:13
Message-ID: 43C28059.30708@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

One more link...
this http://archives.postgresql.org/pgsql-patches/2003-12/msg00049.php
was the final draft of the patch I submitted, with docs patches, that
did not break backward computability (did not rip out the old syntax)
and supported both input and output of ISO-8601 compliant intervals
by setting the datestyle to "iso8601basic" as discussed in the thread
linked in the quoted article below.

It was applied http://archives.postgresql.org/pgsql-patches/2003-12/msg00253.php
and then debated http://archives.postgresql.org/pgsql-patches/2003-12/msg00202.php
and then unapplied http://archives.postgresql.org/pgsql-patches/2003-12/msg00030.php
on Peter Eisentraut's recommendation to implement SQL standard intervals first.

Ron Mayer wrote:
> Larry Rosenman wrote:
>
>> Michael Glaesemann wrote:
>>
>>> On Jan 8, 2006, at 12:12 , Larry Rosenman wrote:
>>>
>>>> I was thinking of handling the TODO for ISO8601 Interval output.
>>>
>>>
>>> Just to be clear, you're talking about the ISO8601 duration syntax
>>> (PnYnMnDTnHnMnS), correct? (The SQL standard made the unfortunate
>>> choice to call durations, i.e., lengths of time, intervals.)
>
>
> Back in 2003 I submitted such a patch [1,1b] that resulted in a fair
> amount of discussion including some still (AFAIK) open issues
> about the naming of the datestyle settings to control it [2,3,4].
>
> There was also some discussion of the range off ISO 8601 durations
> to support (ISO 8601 Basic Format, ISO 8601 Alternative Format,
> and ISO 8601 Extended Format (which is more human-readable)) [5].
>
> Finally, there is a similar, but different syntax currently supported
> by postgresql (where '1Y1M' means 1 year 1 minute, while ISO 'P1Y1M'
> would mean 1 year 1 month) and Tom recommended ripping that code
> out[7] and at one point said my patch was looking cleaner than
> the exiting code [8]. My patch does not yet rip that out.
>
>
> I still use the patch myself, but don't have it updated to CVS tip.
> I'd be happy to do so if people want that as a starting point.
>
> Ron
>
>
> [1] http://archives.postgresql.org/pgsql-patches/2003-09/msg00103.php
> [1b] http://archives.postgresql.org/pgsql-patches/2003-09/msg00286.php
> [2] http://archives.postgresql.org/pgsql-patches/2003-09/msg00122.php
> [3] http://archives.postgresql.org/pgsql-patches/2003-09/msg00129.php
> [4] http://archives.postgresql.org/pgsql-patches/2003-09/msg00130.php
> [5] http://archives.postgresql.org/pgsql-patches/2003-09/msg00133.php
> [6] http://archives.postgresql.org/pgsql-patches/2003-09/msg00134.php
> [7] http://archives.postgresql.org/pgsql-patches/2003-09/msg00134.php
>
> [8] http://archives.postgresql.org/pgsql-patches/2003-09/msg00121.php