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

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Interval code refactoring patch (Was: Re: Patch for ISO-8601-Interval Input and output.)
Date: 2008-11-11 14:11:12
Message-ID: 49199280.3060904@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
cleanup.patch.gz application/x-gzip 12.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-11 14:12:14 Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Previous Message Hiroshi Saito 2008-11-11 14:10:29 Re: [PATCHES] Solve a problem of LC_TIME of windows.