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

From Mark Dilger
Subject Re: [SQL] Interval subtracting
Date
Msg-id 44060814.8030604@markdilger.com
Whole thread Raw
In response to Re: [SQL] Interval subtracting  (Hannu Krosing <hannu@skype.net>)
List pgsql-hackers
Hannu Krosing wrote:
> 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'.

Correct me if I am wrong, but I thought that justify_days would only be called 
if the user wanted it.  I get the following behavior in psql even after the 
patch is applied:

select '2 mons -1 days'::interval;    interval
---------------- 2 mons -1 days


So there does not seem to be any justification going on without the user's 
permission.  Consequently, if you need '2 mons -1 days', don't call justify_days.

Am I missing something?

mark


pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: [SQL] Interval subtracting
Next
From: Mark Kirkwood
Date:
Subject: Re: pg_config, pg_service.conf, postgresql.conf ....