0

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?

asked Apr 2, 2019 at 9:14
3
  • 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

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;

Examples:

In pg_hba.conf you release the IP

# TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.23.43/32 md5 # Only frees a specific ip
host all all 192.168.0.0/16 md5 # Free the entire network 192.168
host all all 192.168.45.0/24 md5 # Frees the entire network 192.168.45
András Váczi
31.8k13 gold badges103 silver badges152 bronze badges
answered Apr 2, 2019 at 12:41
1
  • 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

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.