JDBC driver 9.2 sending arbitrary timezone - Mailing list pgsql-jdbc

From Alexandre Gattiker
Subject JDBC driver 9.2 sending arbitrary timezone
Date
Msg-id CAOfQWyEZwiqBhLhB=QOh8v154n5_c_k59Peai7tDqk1srW8JRw@mail.gmail.com
Whole thread Raw
Responses Re: JDBC driver 9.2 sending arbitrary timezone  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
Hello,

PostgreSQL jdbc jar 9.2-1003-jdbc4 is failing for me, while version 9.1-901-1.jdbc4 works fine. I was able to reproduce the issue by running the jdbc driver's unit tests.

It appears the client is sending to the server the timezone Europe/Busingen, although my timezone is set to Europe/Zurich.

runtest:
    [junit] Testsuite: org.postgresql.test.jdbc2.Jdbc2TestSuite
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] 
    [junit] Null Test:  Caused an ERROR
    [junit] null
    [junit] java.lang.reflect.InvocationTargetException
    [junit] Caused by: org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "Europe/Busingen"
    [junit] at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:572)
    [junit] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:177)
    [junit] at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
    [junit] at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:136)
    [junit] at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29)
    [junit] at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21)
    [junit] at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:31)
    [junit] at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    [junit] at org.postgresql.Driver.makeConnection(Driver.java:406)
    [junit] at org.postgresql.Driver.connect(Driver.java:280)
    [junit] at java.sql.DriverManager.getConnection(DriverManager.java:571)
    [junit] at java.sql.DriverManager.getConnection(DriverManager.java:187)
    [junit] at org.postgresql.test.TestUtil.openDB(TestUtil.java:187)
    [junit] at org.postgresql.test.TestUtil.openDB(TestUtil.java:173)
    [junit] at org.postgresql.test.jdbc2.Jdbc2TestSuite.suite(Jdbc2TestSuite.java:94)
    [junit] ... 25 more



Server: Postgres Plus; PostgreSQL 9.2.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52), 64-bit
CentOS release 6.4 (Final) Linux 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed Jun 12 03:34:52 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/sysconfig/clock 
ZONE="Europe/Zurich"

Regards,
Alexandre

pgsql-jdbc by date:

Previous
From: dmp
Date:
Subject: Updated Website Layout Completed
Next
From: Tom Lane
Date:
Subject: Re: JDBC driver 9.2 sending arbitrary timezone