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-06 16:26:31
Message-ID: 49131AB7.8070309@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Brendan Jurd wrote:
>> I've applied them with a couple minor changes.
>>
>> * If ISO 8601 5.5.3.1.d's statement "The designator T shall be
>> absent if all of the time components are absent." also applies
>> to 5.5.4.2.2; then I think the 'T' needed to be inside the
>> <optional> tags, so I moved it there. The link to the spec's
>> below[1].
>
> Hmm, okay. When I was running my tests in psql I came away with the
> impression that the T was required in the "alternative format". I
> might be mistaken. I'll run some further tests a little later on.

Indeed that's a bug in my code; where I was sometimes
requiring the 'T' (in the ISO8601 "alternative format") and
sometimes not (in the ISO8601 format from 5.5.4.2.1).

Below's a test case. If I read the spec[1] right both of those
should mean 1 day. I'll update git and post a new patch now.
If people think I read the specs wrong, I'll undo this change
and fix the docs.

==========================================================
[2]lt:/home/ramayer/proj/pg% ./psql regression
psql (8.4devel)
Type "help" for help.

regression=# select interval 'P1D';
interval
----------
1 day
(1 row)

regression=# select interval 'P0000-00-01';
ERROR: invalid input syntax for type interval: "P0000-00-01"
LINE 1: select interval 'P0000-00-01';
^
==========================================================

[1]
http://isotc.iso.org/livelink/livelink/4021199/ISO_8601_2004_E.zip?func=doc.Fetch&nodeid=4021199

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-06 16:29:58 Re: plperl needs upgrade for Fedora 10
Previous Message Tom Lane 2008-11-06 16:23:38 Re: RAM-only temporary tables