Re: [SQL] Interval subtracting

From: Mark Dilger <pgsql(at)markdilger(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [SQL] Interval subtracting
Date: 2006-03-02 00:02:58
Message-ID: 44063632.20505@markdilger.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql

Tom Lane wrote:
> Mark Dilger <pgsql(at)markdilger(dot)com> writes:
>
>>justify_days(justify_hours(...)) fixes *everything* in the most recently
>>submitted patch, regardless of the convoluted case you invent. There is no data
>>for which it won't work.
>
>
> If so, one function or the other is cheating. Per discussion,
> justify_hours must never touch months, and I don't believe that
> justify_days should touch seconds either. The proposed justify_interval
> function should have a result different from successive application
> of the two existing functions, because it will ensure that all three
> fields have similar signs whereas separate use of the two functions
> can't promise that in corner cases.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

That depends what you mean by cheating. The justify_hours function looks to see
what answer justify_days would give, but does not actually change the data. I
described this all earlier and I still don't see why there is anything wrong
with it.

mark

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-02 00:37:37 Re: [SQL] Interval subtracting
Previous Message Tom Lane 2006-03-01 23:58:25 Re: [SQL] Interval subtracting

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-03-02 00:37:37 Re: [SQL] Interval subtracting
Previous Message Tom Lane 2006-03-01 23:58:25 Re: [SQL] Interval subtracting

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-03-02 00:37:37 Re: [SQL] Interval subtracting
Previous Message Tom Lane 2006-03-01 23:58:25 Re: [SQL] Interval subtracting