pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Vaibhav Nivargi <vaibhav.nivargi@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Potential inconsistency in handling of timestamps
Date: Fri, 26 Oct 2007 11:18:32 +1300
Message-ID: <47211638.2080404@opencloud.com> (raw)
In-Reply-To: <a16dc64a0710251500v29de2294n864ec1249829f3b0@mail.gmail.com>
References: <a16dc64a0710251500v29de2294n864ec1249829f3b0@mail.gmail.com>

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



view thread (6+ messages)  latest in thread

Message-ID: <47211638.2080404@opencloud.com>
Permalink:  ../47211638.2080404@opencloud.com/
Also on:    postgresql.org/message-id/47211638.2080404@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, vaibhav.nivargi@gmail.com
  Subject: Re: Potential inconsistency in handling of timestamps
  In-Reply-To: <47211638.2080404@opencloud.com>
  References: <a16dc64a0710251500v29de2294n864ec1249829f3b0@mail.gmail.com> <47211638.2080404@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox