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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: R Mayer <pg_cert(at)cheapcomplexdevices(dot)com>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, 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-11 00:58:17
Message-ID: 751.1226365097@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

R Mayer <pg_cert(at)cheapcomplexdevices(dot)com> writes:
> Applied and pushed to the website http://0ape.com/postgres_interval_patches/

I ran into an interesting failure case:

regression=# select interval 'P-1Y-2M3DT-4H-5M-6';
interval
-------------------
P-1Y-2M3DT-10H-5M
(1 row)

This isn't the result I'd expect, and AFAICS the ISO spec does *not*
allow any unit markers to be omitted in the format with designators.
I think the problem is that the code will accept a value as being
alternative format even when it's already read some
format-with-designator fields. I propose adding a flag to remember
that we've seen a field in the current part (date or time) and rejecting
an apparent alternative-format input if the flag is set.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lawrence, Ramon 2008-11-11 01:01:23 Re: WIP: Hash Join-Filter Pruning using Bloom Filters
Previous Message ITAGAKI Takahiro 2008-11-11 00:56:21 Re: pg_do_encoding_conversion glitch