I'm stumped. We have a postgres 9.2 database that we have been using for some time. Now we have a need to be able to connect to it from outside our network.
So we setup an External IP, and tested that we can connect to port 5432 from the remote host via telnet. So this proves that the network connection is working, firewalls, etc all good.
When I try to connect using:
psql -h db.host.com -d dbname -p 5432 -U user
I get back psql: server closed the connection unexpectedly.
I've verified that
listen_addresses = '*' is set in postgresql.conf
And in pg_hba.conf we have a line that reads (just for testing)
host all all 0.0.0.0/0 md5
And I've reloaded the database to verify its picked up the changes.
So this should allow connections from any source.
The psql version on DB server is 9.2.14 and on client is 9.2.13.
Any suggestions or ideas?
0.0.0.0/0
with the actual ip that you're connecting from – Haleemur Ali