PostgreSQL does not accept TCP/IP connections.
search cancel

PostgreSQL does not accept TCP/IP connections.

book

Article ID: 264811

calendar_today

Updated On: 02-07-2024

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

The PostgreSQL database server does not allow remote TCP/IP connections per default:

D:\Automic\External.Resources\postgresql\pgsql\bin>psql -U AUTOMIC AE

psql: could not connect to server: Connection refused (0x0000274D/10061)

        Is the server running on host "localhost" (::1) and accepting

        TCP/IP connections on port 5432?

could not connect to server: Connection refused (0x0000274D/10061)

        Is the server running on host "localhost" (127.0.0.1) and accepting

        TCP/IP connections on port 5432?

Environment

Release: 12.X, 21.X

Cause

Configuration.

Resolution

By default, PostgreSQL does not allow remote connections.  The following lines need to be added to the file pg_hba.conf:

host    all             all              0.0.0.0/0                       md5
host    all             all              ::/0                            md5

This requires a restart of the database.