Also, ensure the necessary login or group roles have CONNECT privileges in the database.
Complete the following steps to allow connections from clients on machines that are remote from the PostgreSQL server:
- Make a backup copy of the pg_hba.conf file before you alter it.
- Open the pg_hba.conf file in a text editor.
- Add the IP addresses of connecting client machines, designate the database or databases each IP address can connect to, and specify the client authentication methods used for connections.
See the PostgreSQL documentation for more information.
- Save and close the pg_hba.conf file.
- If PostgreSQL is installed on a Linux server, reload server configuration settings using a PostgreSQL function such as pg_ctl reload or pg_reload_conf().
- Ensure users have privileges to connect to the database.
By default, the Public group role has CONNECT privileges to all databases in the PostgreSQL database cluster, so you only need to grant the CONNECT privilege to individual login or group roles on specific databases if you revoked the CONNECT privilege from the Public role.