Re: Interval->day proposal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Interval->day proposal
Date
Msg-id 13746.1117636076@sss.pgh.pa.us
Whole thread Raw
In response to Re: Interval->day proposal  (Michael Glaesemann <grzm@myrealbox.com>)
List pgsql-hackers
Michael Glaesemann <grzm@myrealbox.com> writes:
> On Jun 1, 2005, at 1:42 PM, Michael Glaesemann wrote:
>> -- v8.0.3
>> test=# select '25 hours'::interval;
>> interval
>> ----------------
>> 1 day 01:00:00
>> (1 row)
>> 
>> -- new interval code
>> test=# select '25 hours'::interval;
>> interval
>> ----------
>> 25:00:00
>> (1 row)
>> 
>> I'll be digging into the spec later and post what I find. Thoughts?

> I've dug a bit, and this is definitely not spec compliant, as  
> interval hours must be in the range 0-23.

Doesn't bother me.  The spec says what results you must get from
spec-compliant input; I don't think it says we may take only
spec-compliant input.  (If we were to read it that way, we'd have
to rip out every PG extension, not only the interval-related ones.)

The entire *point* of this change is to be able to distinguish
"25 hours" from "1 day 1 hour", so you can hardly argue that being
able to do that is not what we want it to do...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Brusser, Michael"
Date:
Subject: fdatasync failed, I/O error
Next
From: Tom Lane
Date:
Subject: Re: Interval->day proposal