Re: roundoff problem in time datatype - Mailing list pgsql-hackers

From Tom Lane
Subject Re: roundoff problem in time datatype
Date
Msg-id 284.1127754021@sss.pgh.pa.us
Whole thread Raw
In response to Re: roundoff problem in time datatype  (Andreas Pflug <pgadmin@pse-consulting.de>)
Responses Re: roundoff problem in time datatype
List pgsql-hackers
Andreas Pflug <pgadmin@pse-consulting.de> writes:
> Tom Lane wrote:
>> b) If SD is TIME WITHOUT TIME ZONE, then TV is SV, with
>> implementation-defined rounding or truncation if necessary.
>> 
>> So it's "implementation-defined" what we do.

> IMHO Since 23:59:59.99 probably means "the last milliseconds of this 
> day, as far as precision allows to express it", this should be truncated 
> to 23:59:59, not rounded to 24:00:00. Until the last microsecond has 
> elapsed, it's not 24 hours (you wouldn't round "happy new year" at 
> 23:59:30 from a clock with minutes only either)

Hm, so the proposal is "round unless that would produce 24:00:00, in
which case truncate"?  Seems a bit ugly but it would follow the letter
of the spec, and avoid rejecting inputs that we used to accept.  It's
still not very clear what to do with '23:59:60.9' though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: On Logging
Next
From: Bruce Momjian
Date:
Subject: Re: Patching dblink.c to avoid warning about open transaction