Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: jdbc pg_hba.conf error



W/out specifying a -h switch, postgres defaults to using a UNIX domain socket, meaning AF_UNIX and not AF_INET. There is a big difference. Using -h 127.0.0.1 is the localhost not necessarily 'local' from the context of postgres. W/out looking into the details, I think 'local' is referring to AF_UNIX. In other words, without specyfing the -h switch, when you have connected, do a "netstat -an" you'll see there are no TCP/IP(AF_INET) sockets connected, but rather there is a AF_UNIX socket connected which will be somewhere in /tmp/blah.s.psostgres.5000 or something similar.



On Thu, 31 May 2007, Oliver Elphick wrote:

On Thu, 2007-05-31 at 09:38 -0400, Bhavana.Rakesh wrote:
Hi,
Here's what happens when I specify the port number

[brakesh(at)lnx383 ~]$ psql -U brakesh -p 5000 -h 127.0.0.1 -d testing123
psql: could not connect to server: Connection refused
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 5000?

Since that command without "-h 127.0.0.1" does work, the clear
implication is that somehow there is a postmaster listening on port 5000
to Unix sockets and a different postmaster, presumably with a different
pg_hba.conf, listening on port 5432 on 127.0.0.1.




--
Louis Gonzales
louis(dot)gonzales(at)linuxlouis(dot)net
http://www.linuxlouis.net




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group