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

From Tom Lane
Subject Re: [SQL] Interval subtracting
Date
Msg-id 14928.1141245328@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] Interval subtracting  (Hannu Krosing <hannu@skype.net>)
List pgsql-hackers
Hannu Krosing <hannu@skype.net> writes:
> But unfortunately '2 mons -1 days' <> '1 mons 29 days'
> If I want something to happen 1 day less than two months from dome date,
> then the only way to say that consistently *is* '2 mons -1 days'.

Sure, but if you want to represent that then you don't pass the value
through justify_days().  The entire premise of justify_days() is that
1 month is interchangeable with 30 days and we should try to make the
value "look nice" given that assumption.

I think everyone's independently arrived at the same thought that
justify_days should not produce a result with different signs for month
and day (except for the case with month = 0, per my last message).
        regards, tom lane


pgsql-hackers by date:

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