Re: Bug in JDBC-Driver?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Antje(dot)Stejskal(at)ppi(dot)de, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug in JDBC-Driver?
Date: 2004-12-18 06:21:31
Message-ID: 28459.1103350891@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka <books(at)ejurka(dot)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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-12-18 06:36:23 Re: Bug in JDBC-Driver?
Previous Message Kris Jurka 2004-12-18 05:15:54 Re: Bug in JDBC-Driver?