Re: [SQL] Interval subtracting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Dilger <pgsql(at)markdilger(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [SQL] Interval subtracting
Date: 2006-03-01 21:11:09
Message-ID: 15320.1141247469@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql

Mark Dilger <pgsql(at)markdilger(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2006-03-01 21:21:36 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 21:04:02 Re: [SQL] Interval subtracting

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Dilger 2006-03-01 21:21:36 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 21:04:02 Re: [SQL] Interval subtracting

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Dilger 2006-03-01 21:21:36 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 21:04:02 Re: [SQL] Interval subtracting