Re: BUG #1993: Adding/subtracting negative time intervals - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1993: Adding/subtracting negative time intervals
Date
Msg-id 9337.1130213038@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #1993: Adding/subtracting negative time intervals  (Michael Fuhr <mike@fuhr.org>)
Responses Re: BUG #1993: Adding/subtracting negative time intervals
List pgsql-bugs
Michael Fuhr <mike@fuhr.org> writes:
> Should 24 hours be the same as 1 * 24 hours?

Yes, I would think so.

> The latter appears to be equal to 1 day, not 24 hours:

Urgh.  I think this is a serious thinko in Michael Glaesemann's rewrite
of interval_mul.  The application of interval_justify_hours is utterly
wrong ... and in fact, I'm not sure it should be applied in any of the
three functions that currently call it.  I don't mind the user deciding
he'd like to flatten '24 hours' to '1 day' but the basic arithmetic
functions for intervals have no business doing that.

Comments?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #1993: Adding/subtracting negative time intervals
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #1993: Adding/subtracting negative time intervals