Re: Bug in JDBC-Driver? - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: Bug in JDBC-Driver?
Date
Msg-id 28459.1103350891@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in JDBC-Driver?  (Kris Jurka <books@ejurka.com>)
Responses Re: Bug in JDBC-Driver?
Re: Bug in JDBC-Driver?
List pgsql-jdbc
Kris Jurka <books@ejurka.com> writes:
> The second approach forces the server timezone to be the JVM's via the
> pseudo sql/java:

> SET TIMEZONE = java.util.TimeZone.getDefault().getID();

> This is a little more intrusive on the server side, but it should not be
> visible using standard JDBC calls for date and time information.  The
> attached patch implements this and I plan to apply it unless someone has a
> better idea or a reason it won't work.

The really serious problem with this is the assumption that the server
has the same set of available timezones (and spellings of same) as the
client does.

I'm not sure that there is a better alternative, mind you.  Just
pointing out that the emperor doesn't really have any clothes on.

In 8.0 and later you can presume that the server is following the
zic database's set of timezone names, but I dunno whether that has
anything to do with the Java universe.  Pre-8.0, you'd be foolish
to assume much of anything.

It's not quite too late to make TimeZone be one of the GUC_REPORT
settings in 8.0, if that would help your problem.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Bug in JDBC-Driver?
Next
From: Kris Jurka
Date:
Subject: Re: Bug in JDBC-Driver?