How to resolve Error "Cause: FATAL: no pg_hba.conf entry for host" while connecting to Postgres database?
book
Article ID: KB0072396
calendar_today
Updated On:
Products
Versions
TIBCO Data Virtualization
All supported versions
Description
This article lists down the suggestions to resolve the below FATAL error that is encountered when establishing a connection to Postgres DB.
Error: Cause: FATAL: no pg_hba.conf entry for host "10.XXX.1XX.1X", user "tdv_readyonly", database "postgresdb", SSL off [Log ID: b9d7a290-27dd-484a-bbac-defec6db5769]
Issue/Introduction
How to resolve Error "Cause: FATAL: no pg_hba.conf entry for host" while connecting to Postgres database?
Resolution
Suggestion #1: In TIBCO Data Virtualization Studio,open the Postgres Data source andadd 'sslmode=require' to the JDBC URL in the 'Connection URL Pattern' field. Save this change, close, and open the data source to test the connection. Example: jdbc:postgresql://<HOST>:<PORT>/<DATABASE_NAME>?sslmode=require
Suggestion #2: If the above suggestion does not help, remove it and follow the below steps: These steps have to be done at the Postgres DB side by the DBA.
(i). Add the following line in Postgresql.conf file: listen_addresses = '*'
(ii). Add the following line at bottom of pg_hba.conf. This allows access to all databases for all users: host all all xxx.xxx.xxx.xxx/32 md5
Note: Here, xxx.xxx.xxx.xxx is the IP address of the TIBCO Data Virtualization Server from where you are connecting to the PostgreSQL Database.
(iii). Restart PostgreSQL you are trying to connect to after making the above changes.