Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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;
 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;
(1 row)

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

			regards, tom lane

In response to

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group