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 the parameter "TimeZone": "America / New_York" on 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 manually due to 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. When I changed TZ to GMT on a Linux system, the connection works, but this is not a good solution.

Any idea what I am doing to fix this?

Thank,

Ken

+4
source share
1 answer

Pavel Horal had the correct answer. Postgres installation was corrupted, and only root had access to the directory / usr / local / pgsql _933 / share / timezone / America. As soon as I did chmod on this and the files in it, my problem disappeared.

+1
source

Source: https://habr.com/ru/post/1536461/


All Articles