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

From Tom Lane
Subject Re: [SQL] Interval subtracting
Date
Msg-id 15320.1141247469@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:
> The current code (without the patch) behaves as follows:

>    select justify_days(justify_hours('1 month 95 days -36:00:00'::interval));
>          justify_days
>    -------------------------
>     4 mons 4 days -12:00:00

So?  If we liked the current behavior we wouldn't be discussing a patch...

My thought is that justify_hours should reduce that input to
'1 month 93 days 12:00:00' and then justify_days would produce
'4 months 3 days 12:00:00'.
        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