I have a PostgreSQL 9.3 DB which I want to connect with no password from localhost only. If connection is made from any other server, then I want the DB to prompt for a password. I just want no password connection from localhost only. The pg_hba.conf looks like:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all password
# IPv4 local connections:
host all all localhost password
# IPv6 local connections:
host all all all password