Re: roundoff problem in time datatype

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: roundoff problem in time datatype
Date: 2005-09-26 16:22:17
Message-ID: Pine.LNX.4.44.0509261812420.28238-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, 26 Sep 2005, 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.

Truncation would avoid the problem but of course loses some of the info.

So, what are the alternatives:

* Truncation.

* Rounding and let it wrap when rounding up towards midnight.

* Rounding and never let it wrap. The cases that would wrap
goes to 23:59:59 (or 23:59:59.9 and so on for other precisions)
or to 23:59:60 (or 23:59.60.9 and so on) if one start with a
leap second time.

Are there any more viable cases?

--
/Dennis Björklund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2005-09-26 16:23:06 Re: roundoff problem in time datatype
Previous Message Alvaro Herrera 2005-09-26 16:15:45 Re: Vacuum questions...

Browse pgsql-patches by date

  From Date Subject
Next Message Andreas Pflug 2005-09-26 16:23:06 Re: roundoff problem in time datatype
Previous Message Gaetano Mendola 2005-09-26 16:13:58 Re: roundoff problem in time datatype