Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 453EA9F9FDB for ; Thu, 25 Oct 2007 19:18:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 97514-02-4 for ; Thu, 25 Oct 2007 19:18:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 2E1ED9F9943 for ; Thu, 25 Oct 2007 19:18:31 -0300 (ADT) Received: from 222-154-141-112.jetstream.xtra.co.nz ([222.154.141.112] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IlB22-0006M3-DQ; Fri, 26 Oct 2007 11:18:26 +1300 Message-ID: <47211638.2080404@opencloud.com> Date: Fri, 26 Oct 2007 11:18:32 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Vaibhav Nivargi CC: pgsql-jdbc@postgresql.org Subject: Re: Potential inconsistency in handling of timestamps References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/136 X-Sequence-Number: 17708 Vaibhav Nivargi wrote: > Hi, > I am using PG-jdbc-8.2-506 to connect to a Postgres DB with a table > containing a timestamp column. Some entries for this are null. When I > try to retrieve the entries, I get a Bad Value PSQLException for rows > which have the timestamp set to null. I was able to trace it to > org/postgresql/jdbc2/Timestamputils.java: loadCalender() which > explicitly checks whether the timestamp has either a date or time > value, else throws an exception. > > OTOH, setting a timestamp to null through jdbc (Update stmt) works > without error. This seems like inconsistent behavior. > > Am I missing something? Any special settings for handling null > timestamp/date values? Null values should in theory get handled and returned well before TimestampUtils ever gets invoked (see AbstractJdbc2ResultSet.getTimestamp()). Can you supply a testcase demonstrating the problem? -O