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