postgres connection refused on localhost but works via socket
@sungodtemple▲ 0 net votes
psql defaults to the Unix socket on Debian/Ubuntu; connecting to 127.0.0.1 explicitly goes TCP, which needs listen_addresses including localhost and pg_hba.conf entries for host. If socket works but TCP doesn't, it's pg_hba.conf not a running-server problem.