I have configured my PostgreSQL server to listen on all addresses and set a port forwarding rule.

I know this has worked as a colleague who works remote can access it fine. I also accessed it remotely myself.

However, when attempting to demonstrate to a client on their network, QGIS was unable to connect. It asked if the server was on and accepting connections on the port. I don't understand why it wouldn't work.

They have said it is not their firewall (as this was my first thought).

Is there anything obvious it could be?

  • So, can you access Postgres from other networks - and the problem is only with the specific one? Commented Apr 2, 2019 at 9:40
  • Correct. I can connect locally (as you'd expect), but also managed it on a train and my colleague did so from home as well. Commented Apr 2, 2019 at 9:49
  • 1
    You should try connecting with psql and see what errors you get, if any (or just telnet to Postgres' IP address at the specific port, to see if it is accessible from that network). Perhaps it's the connection settings in QGIS. Commented Apr 2, 2019 at 9:56

1 Answer 1


I think first you would edit the postgres log file to see if you have any messages related to the server that is trying to connect to the database. Shortly after you check the parameters to be changed for access to the database.

In the postgresql.conf file you change the parameter

listen_addresses = '*' # what IP address (es) to listen on;


In pg_hba.conf you release the IP

host   all      all md5    # Only frees a specific ip
host   all      all   md5    # Free the entire network 192.168
host   all      all  md5    # Frees the entire network 192.168.45
  • Hi Wellington, thank you for this suggestion. In the log I am seeing LOG: could not receive data from client: An existing connection was forcibly closed by the remote host. But no indication of a specific IP Commented Apr 2, 2019 at 13:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.