Posts

Showing posts with the label pg_hba

Postgresql server connectivity configurations from other clients or servers

Problem: When i am trying to read the data of postgresql from other server (XHQ Connection Group), got the below error. To fix this i have done the below step.  Error Connecting to database FATAL : no pg_hba.conf entry for host"18.142.0.78", user"postgres", database"UNLSH_WB_COLLECTIONS".  Solution: To fix this problem i have added below line under " # IPv4 local connections: " in " pg_hba.conf " file in postgresql server and also opened postgresql port " 5432 " at firewall level (both inbound and outbound).  host    all         all         52.77.217.218/24     trust File " pg_hba.conf " will be available in postgresql data folder. To find the data folder, we have to run the sql command " SHOW data_directory; " in postgresql database.

Process to connect postgresql server from client

To configure remote hosts and users that can connect to the PostgreSQL service, you need to edit the pg_hba.conf file (This file will be in Data directory). In our sample installation, we want to allow users from any host on the local network to access all of the databases on our server. To do this, we add the following line at the end of the file: host   all   all   192.168.0.0/16   md5 This means that all computers with an IP address that begins 192.168 can access all databases. The simplest way to make this configuration change take effect is to restart the PostgreSQL server.