Re: [SQL] Interval subtracting

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

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> Based on that, I guess I have to change my vote: justify_hours should
> >> still not look at the month (because it shouldn't use the month=30days
> >> assumption), but justify_days should be changed to be effectively a
> >> combination of both functions --- that is, it should fix all three
> >> fields using both the 30days and the 24hours assumptions. Then it could
> >> guarantee that all come out with the same sign.
>
> > If we do that, we should just call it justify_interval(). I am thinking
> > this is the direction to go, and for people who want more control they
> > use the justify_hours and justify_days, and those are left unchanged.
>
> Well, the question is whether justify_days has a sane definition that is
> different from this. Based on your example, I'm not seeing one.

Uh, justify days only deals with days <--> months conversions. There is
no processing for hours. I don't understand your comment.

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-01 23:17:45 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 23:10:18 Re: [SQL] Interval subtracting

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-03-01 23:17:45 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 23:10:18 Re: [SQL] Interval subtracting

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-03-01 23:17:45 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 23:10:18 Re: [SQL] Interval subtracting