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 23:58:25
Message-ID: 17317.1141257505@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:
> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2006-03-02 00:02:58 Re: [SQL] Interval subtracting
Previous Message seth.m.green 2006-03-01 23:55:26 ACCESS EXCLUSIVE LOCK

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Dilger 2006-03-02 00:02:58 Re: [SQL] Interval subtracting
Previous Message seth.m.green 2006-03-01 23:55:26 ACCESS EXCLUSIVE LOCK

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Dilger 2006-03-02 00:02:58 Re: [SQL] Interval subtracting
Previous Message Mark Dilger 2006-03-01 23:49:46 Re: [SQL] Interval subtracting