I have a Postgres instance running on an Azure VM, which is inside an Azure Virtual Network, and the VM has a hostname. Connecting with PostgreSQL using the IP address works, but when I try to connect using the hostname it gives this error:
psql: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
Pinging to the hostname works. The connection goes through a DNS forwarder. The configurations of
/postgresql.conf looks like this:
listen_addresses = '*' tcp_keepalives_idle = 120 tcp_keepalives_interval = 30 tcp_keepalives_count = 9
and it currently accepts all connections
all all 0.0.0.0/0 md5
What is the cause of this issue, and how can it be solved?