Re: getTiIme/Timestamp with TimeZone inconsistency - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: getTiIme/Timestamp with TimeZone inconsistency
Date
Msg-id 49FE3A4D.5050704@opencloud.com
Whole thread Raw
In response to Re: getTiIme/Timestamp with TimeZone inconsistency  (John Lister <john.lister-ps@kickstone.com>)
List pgsql-jdbc
John Lister wrote:

> I agree the JDBC spec is vague, but I read the spec such that the
> supplied calendar is *only* used if the server doesn't support a
> timezone. I think my main concern is that setTimestamp behaves
> differently to setTime. I'm not sure which is correct (i'd tend to the
> former) but i think they should behave the same...

The problem is that there's a bit of a disconnect between the server's
idea of time / timestamp with or without timezone, and the Java
representations. java.sql.Time is just a hideous hack to begin with.
It's going to be at best a patch job getting them to fit together.

> I'm not sure what the correct behaviour should be if the server has a
> timezone and you specify one to use. Hopefully the app writer would only
> use this case for none timezone columns/results.... maybe too much to
> ask for :)

I'm reluctant to touch that date/time handling code without an actual
testcase showing a problem. It's quite fragile as it is, and small
changes can have unintended consequences :/

-O


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Unit test patches
Next
From: Péter Kovács
Date:
Subject: Re: Very strange performance decrease when reusing a PreparedStatement