R Mayer <pg_cert@cheapcomplexdevices.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