Re: BUG #1927: incorrect timestamp returned

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: postgres(at)saparev(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1927: incorrect timestamp returned
Date: 2005-10-04 15:47:37
Message-ID: 200510041547.j94FlbL19960@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Right. We allow leap seconds for any date/time. Are you saying we
> > should only allow them for certain dates/times?
>
> No, his point is the funny roundoff behavior.
>
> regression=# select timestamp '2005-09-23 23:59:59.999999';
> timestamp
> ----------------------------
> 2005-09-23 23:59:59.999999
> (1 row)
>
> regression=# select timestamp '2005-09-23 23:59:59.9999999';
> timestamp
> ------------------------
> 2005-09-23 23:59:60.00
> (1 row)
>
> regression=# select timestamp '2005-09-23 23:59:59.99999999';
> timestamp
> ---------------------
> 2005-09-24 00:00:00
> (1 row)

Wow, that is funny roundoff behavior. Has anyone researched the cause?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jean-Pierre Pelletier 2005-10-04 16:24:20 Possibly corrupted shared memory, PostgreSQL 8.1 beta2, Windows 2000
Previous Message Tom Lane 2005-10-04 15:38:30 Re: BUG #1927: incorrect timestamp returned

Browse pgsql-patches by date

  From Date Subject
Next Message David Fetter 2005-10-04 16:41:03 Re: [HACKERS] Best practices: MERGE
Previous Message Tom Lane 2005-10-04 15:38:30 Re: BUG #1927: incorrect timestamp returned