08001: sqlclient_unable_to_establish_sqlconnection
PostgreSQLWhat does it mean?
The client could not establish a connection to the PostgreSQL server. The connection failed at the network/address level, before it became a session.
Why does it happen?
Wrong host/port; an address the server is not listening on (connecting remotely while listen_addresses = 'localhost'); the server is down/unreachable; a firewall blocks the port (default 5432); or a DNS resolution failure. A misconfigured connection pool can also trigger it.
How to fix it
Verify that the server is up and listening on the correct address: check listen_addresses = '*' (or the relevant IP) and the port setting in postgresql.conf, then restart the server (listen_addresses and port require a restart; a reload is not enough). Test access from the client: psql -h host -p 5432 -U app_user. Open 5432/tcp in the firewall. Review the host/port/DNS values and the connection string.