Re: Bug in storing Timestamp
| От | Tom Lane | 
|---|---|
| Тема | Re: Bug in storing Timestamp | 
| Дата | |
| Msg-id | 29958.1113232047@sss.pgh.pa.us обсуждение исходный текст  | 
		
| Ответ на | Re: Bug in storing Timestamp ("mikael-aronsson" <mikael-aronsson@telia.com>) | 
| Список | pgsql-jdbc | 
"mikael-aronsson" <mikael-aronsson@telia.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
		
	В списке pgsql-jdbc по дате отправления: