Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres and c3p0 invalid timezone error during connection

I get the following error when trying to connect a standalone Java application to Postgres:

org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "America/New_York" at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java 572) ... at com.mchange.v2.c3p0.DriveManagerDataSource.getConnection(DriveManagerDataSource.java: 164) ...

(sorry, I have to type this in by hand because of my setup).

I am using Postgres 9.3.3 with PostGIS 2.1.1 extensions, the Postgres 9.3-1100 jdbc driver and the 0.2.6.3 c3p0 library.

I get this on both Linux and Windows systems. When I changed the TZ to GMT on the Linux system the connection works, but that's not a good solution.

Any idea what I con do to fix this?

Thanks,

Ken

like image 512
user3361199 Avatar asked Nov 01 '22 01:11

user3361199


1 Answers

Pavel Horal had the correct answer. The Postgres installation was messed up and only root had access to the /usr/local/pgsql_933/share/timezone/America directory. Once I did a chmod on that and the files in it my problem went away.

like image 162
user3361199 Avatar answered Nov 09 '22 13:11

user3361199