Wayne Pierce <shalofin@gmail.com> writes:
> I have PostgreSQL setup and everything is working fine when I use
> "psql -d <dbName>" on the command line or when I use mod_python to
> connect. However I when I use "psql -h localhost <dbName> postgres" I
> get the following error:
> psql: could not connect to server: Connection refused
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
This is a kernel-level refusal: your connection request never got to the
postmaster at all, ergo the contents of pg_hba.conf etc are irrelevant.
Assuming you did start the postmaster with tcpip_socket enabled, the
only other possibility I know of is that the kernel is refusing the
connection because of packet filtering rules. Check your firewall
setup and see what sort of restrictions are imposed on localhost
connections. You at least want to allow traffic to/from port 5432,
and may want to loosen it up more while you are at it.
regards, tom lane