0

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.

3
  • I reckon you should show the exact error message text :p . Separately, 8.3.7, really? Any reason you're relying on a fossil database? Commented Sep 5, 2014 at 11:03
  • Yep there is a reason. The whole server room and the software is fossil and I have no means of updating it. This place is hell I tell you. Problem fixed by restarting the DB - I guess the hbconf rule didn't apply for some reason. Wonder why PgAdmin was still able to connect from the same PC? Commented Sep 5, 2014 at 12:08
  • Per the documenation, pg_hba.conf changes only take effect when you reload the server - either restarting it, using SELECT pg_reload_conf(), or sending a SIGHUP to the postmaster (possibly via pg_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. Commented Sep 5, 2014 at 12:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.