Re: Bug in storing Timestamp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "mikael-aronsson" <mikael-aronsson(at)telia(dot)com>
Cc: "Boris Kirzner" <borisk(at)mainsoft(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug in storing Timestamp
Date: 2005-04-11 15:07:27
Message-ID: 29958.1113232047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

"mikael-aronsson" <mikael-aronsson(at)telia(dot)com> writes:
> I have never had any problems with timestamps, if I remember correct the
> resolution gets worse when you get far away from 1900 or so, is it possible
> that using year 0001 gives that bad resolution maybe ?

Good thought, but no; the error at 0001 is still down around the sixth
decimal place:

regression=# select '0001-01-01 02:02:02.123456'::timestamp;
timestamp
----------------------------
0001-01-01 02:02:02.123459
(1 row)

I was wondering about the fact that he was storing into a time column
rather than a timestamp. That works if the conversion is done on the
server, modulo the sixth decimal place again:

regression=# select '0001-01-01 02:02:02.123456'::timestamp::time;
time
-----------------
02:02:02.123459
(1 row)

but maybe it's confusing the JDBC driver into doing the wrong thing
entirely.

regards, tom lane

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Joost Kraaijeveld 2005-04-11 20:32:42 JBoss, PostgreSQL and XDoclets question
Previous Message mikael-aronsson 2005-04-11 14:57:57 Re: Bug in storing Timestamp