X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 09A2F538AF for ; Mon, 11 Apr 2005 12:07:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55405-08 for ; Mon, 11 Apr 2005 15:07:34 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2CFED537D1 for ; Mon, 11 Apr 2005 12:07:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j3BF7RuY029959; Mon, 11 Apr 2005 11:07:27 -0400 (EDT) To: "mikael-aronsson" Cc: "Boris Kirzner" , pgsql-jdbc@postgresql.org Subject: Re: Bug in storing Timestamp In-reply-to: <008901c53ea6$d955f6b0$8ba7e551@w128mtec> References: <425A701C.6070608@mainsoft.com> <008901c53ea6$d955f6b0$8ba7e551@w128mtec> Comments: In-reply-to "mikael-aronsson" message dated "Mon, 11 Apr 2005 16:57:57 +0200" Date: Mon, 11 Apr 2005 11:07:27 -0400 Message-ID: <29958.1113232047@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/68 X-Sequence-Number: 12675 "mikael-aronsson" 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