I just wasted an hour of my life trying to figure out why pgAdminIII couldn't connect to the server on localhost
. After trying config edits, starting/stopping the postgresql service, etc., I finally realized only one thing had changed since the last time I used pgAdminIII: I was connected to my VPN.
I'm no network wizard, so that's why I'm asking here: why can't I connect to PostgreSQL (localhost) when I'm actively connected to my VPN provider?
Bonus: what commands/steps can I use to show exactly why?
EDIT:
pg_hba.conf:
...
# CAUTION: Configuring the system for local "trust" authentication
# allows any local user to connect as any PostgreSQL user, including
# the database superuser. If you do not trust all your local users,
# use another authentication method.
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication chris trust
#host replication chris 127.0.0.1/32 trust
#host replication chris ::1/128 trust
OS X version: 10.12.6 (Sierra)
PostgreSQL version: 9.6.3
VPN provider: ExpressVPN
localhost:5432
(the default).