I have a database server (192.168.1.50) running postgres. I have created a database named \"testdb\" and a user \"testuser\" with password \"testuserpw\".
Locally, I can
I came across the same problem as yours, and my source of problem is the firewall settings.
If you're using Ubuntu, print your firewall status:
sudo ufw status verbose
It may looks like this:
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
...
The default rule of incoming connection is "deny", so you need to specify the "allow"ed port.
type:
sudo ufw allow 5432/tcp
reference: https://www.vultr.com/docs/how-to-configure-ufw-firewall-on-ubuntu-14-04