Re: [SQL] Interval subtracting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [SQL] Interval subtracting
Date
Msg-id 17317.1141257505@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] Interval subtracting  (Mark Dilger <pgsql@markdilger.com>)
Responses Re: [SQL] Interval subtracting  (Mark Dilger <pgsql@markdilger.com>)
List pgsql-hackers
Mark Dilger <pgsql@markdilger.com> writes:
> justify_days(justify_hours(...)) fixes *everything* in the most recently 
> submitted patch, regardless of the convoluted case you invent.  There is no data 
> for which it won't work.

If so, one function or the other is cheating.  Per discussion,
justify_hours must never touch months, and I don't believe that
justify_days should touch seconds either.  The proposed justify_interval
function should have a result different from successive application
of the two existing functions, because it will ensure that all three
fields have similar signs whereas separate use of the two functions
can't promise that in corner cases.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: [SQL] Interval subtracting
Next
From: Mark Dilger
Date:
Subject: Re: [SQL] Interval subtracting