Interval code refactoring patch (Was: Re: Patch for ISO-8601-Interval Input and output.) - Mailing list pgsql-hackers

From Ron Mayer
Subject Interval code refactoring patch (Was: Re: Patch for ISO-8601-Interval Input and output.)
Date
Msg-id 49199280.3060904@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Patch for ISO-8601-Interval Input and output.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> ...failure case ... interval 'P-1Y-2M3DT-4H-5M-6';
> 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.

Yes, this is true. I see you already made the change.

Tom Lane wrote:
> Applied with nontrivial revisions --- I fear I probably broke your third
> patch again :-(.

No problem. It wasn't hard to update.  Attached is an updated patch (as
well as being updated on my website; but since it applies to HEAD it's
as easy to get here).

The bulk of the changes are in regression tests where rounding of
fractional seconds was changed as discussed up-thread back in Sep.

Seems I should also submit one more patch that merge the newest
DecodeInterval, EncodeInterval and related functions into
/ecpg/pgtypeslib/interval.c?

And beyond that, there's still some eccentricities with the interval code
(why's "interval '1 year 1 year'" ok but "interval '1 second 1 second'" not)
but I don't know if I'd do more harm or good trying to look at those.


Attachment

pgsql-hackers by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows.
Next
From: Euler Taveira de Oliveira
Date:
Subject: Re: autovacuum and reloptions