Re: BUG #4853: millisecond is incorrect?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiromichi Nakajima" <hirolin7(at)yahoo(dot)co(dot)jp>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4853: millisecond is incorrect?
Date: 2009-06-15 14:28:55
Message-ID: 15121.1245076135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Hiromichi Nakajima" <hirolin7(at)yahoo(dot)co(dot)jp> writes:
> I execute sql below:
> INSERT INTO A_TBL ( OPE_DATE) VALUES ( '2009-06-15 18:29:58.156')
> and show value with sql below:
> select TO_CHAR ( OP_DATE, 'YYYY-MM-DD HH24:MI:SS.MS.US')
> It must show as '2009-06-15 18:29:58.156.156000'
> but sometimes '2009-06-15 18:29:58.156.155999'
> Is it bug?

No, it's an inherent consequence of the fact that floating-point
timestamps aren't infinitely precise.

> This doesn't occur on 8.2.4.

The 8.2 coding had a different set of problems :-(
http://archives.postgresql.org/pgsql-bugs/2007-02/msg00090.php

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Hiroshi Saito 2009-06-15 15:15:01 Re: BUG #4852: PostgreSQL ODBC driver doesn't work
Previous Message Hiromichi Nakajima 2009-06-15 09:40:00 BUG #4853: millisecond is incorrect?