I've got a VPN to my server network set up. Everything works fine, I can ping servers and ssh around the network. Except for the database connection.
When I use PgAdmin on ubuntu and insert connection details (ip,host etc.) it connects without problems. But when I try the same with Python psycopg2/PyGreSql I either get a can't resolve hostname error (name or service not known) or no hba.conf rule error. I added the rule and it didn't change anything.
I reckon that if the rule didn't work PgAdmin wouldn't connect.
PgSql ver: 8.3.7 on Debian 4.3.2 Pgadmin3 ver - newest for ubuntu (1.18.1) psycopg2/PyGreSql - newest versions from pip.
While I'm not sure about psycopg2, PyGreSql should support my old database version, so that shouldn't be the problem.
pg_hba.conf
changes only take effect when you reload the server - either restarting it, usingSELECT pg_reload_conf()
, or sending aSIGHUP
to the postmaster (possibly viapg_ctl reload
). I expect your PgAdmin connection worked because you were connection with different options - different database name, username, source host address, ssl mode, etc. – Craig Ringer Sep 5 '14 at 12:09