Postgres and c3p0 invalid timezone error during connection - postgresql

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

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.

Check your default timezone in postgresql(UTC) and make sure connection timezone and default are same.

Related

Failed PostgreSQL database connection in Pentaho Data Integration PDI

Objective: Set up a connection with PostgreSQL db in PDI. I'm a noob in all this stuff, so each step forward requires long resolution time.
I'm trying to set up the connection to a PostgreSQL database in order to prepare some queries for an ETL process in PDI. But there's no way to succeed with the connection.
I've tried with PostgreSQL connection type and with Generic database connection type and the error is always related with the drivers.
The version of the PostgreSQL db I'm trying to connect is 9.5.25 and I'm working in Ubuntu 20.04 and Java 8 as demands Pentaho Data Integration.
Below the error message after failed connection:
"Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed. Connection to [IP]:[Port] refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections."
I am literally in despair, don't know what I'm doing wrong. Will be very grateful with anyone who can help me.
You need to add the jdbc driver to connect to postgresql DB in the pdi-installation/lib directory, you just put the *.jar file there and restart spoon to have the library available.
That driver can be downloaded from postgresql downloads. The Community Edition of PDI only comes with a small number of jdbc drivers, for each type of database you need to connect to, you should check if the jdbc driver is available in that directory, and if it's up to date or if you need a more recent version of the driver.
This is a link for the official Pentaho documentation, looking for information in Hitachi Vantara documentation is becoming more and more difficult, they don't always clarify what steps apply only for the Enterprise Edition and are not available for the Community Edition: https://help.hitachivantara.com/Documentation/Pentaho/9.2/Setup/JDBC_Drivers_Reference

Squirrel SQL gives: FATAL: database "localhost:5432:postgres" does not exist

I want to use Squirrel SQL since it seems a good alternative to pgAdmin but I do not succeed to connect with database postgresSQL, respectively, MariaDB. The error I got is:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: database "localhost:5432:postgres" does not exist
I have the following environment: Windows 7, postgreSQL 9.6, MariaDB 10.2. I can connect both databases with terminal or pgAdmin, respectively, HeidiSQL. So, I think I do something fundamentally wrong when trying to connect to the databases with Squirrel SQL.
Here are the detailled steps I did:
(1) The drivers are in C:\Program2\db_drivers and also the databases are installed in directory \Program2:
(2) I could register the drivers:
(3) Then I tried to make an alias:
(4) ... but got this error:
As documented in the manual the URL should be:
jdbc:postgresql://localhost:5432/postgres

Laravel 5 + Postgresql Connection

I have some problem in Postgre SQL, i can't connect my project Laravel 5 into Postgre SQL(i'm using PG Admin III), of course i remember the password in the first time i installed the Postgresql. but i think the problem is default username for database PostgreSQL, i try use "root",and "postgres" but both is failed. maybe someone know a default username for postgresql
PS: i've already configuring default into pgsql in database.php file and .env file
note: the error is (i tried in tinker laravel) "PDO exception with message could not find any driver"

postgres 9.4 timezone unknown

My company just upgraded from postgres 9.0.4 to postgres 9.4.2
when timezone unknown was specified in the postgres.conf file in 9.0.4, postgres "figured out" what the local timezone was, and set that as the local timezone.
in 9.4.2 the documentation says that if not specified it uses GMT.
I want to know if there's a way to get the legacy behavior
I got the answer mostly from information from Tom Lane.
postgres 9.2+ "figures out" the local timezone during initdb.

Postgres NetBeans connection driver issue

I am tryng to configure a connection to postrgresql db server via Services window of Netbeans 7.3.1 and I get the following error:
Cannot establish a connection to jdbc:postgresql://xxx.xxx.xx:5432/ using org.postgresql.Driver (ERROR: Unsupported startup parameter: extra_float_digits)
I have foud a possible workaround :
ignore_startup_parameters = extra_float_digits
Is there some way to set this parameter in a config file?
Thanks
From PostgreSQL 9.2, a new server parameter extra_float_digits is added to control precision display of floating-point numbers Source. I think that it is better to use the right jdbc version for your server PostgreSQL version(9.0.3.2). In your case 9.0-802 JDBC 4