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

Re: authentication problems

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Russ McBride <Russ(at)psyex(dot)com>
Cc: nickf(at)ontko(dot)com, pgsql-admin(at)postgresql(dot)org
Subject: Re: authentication problems
Date: 2001-09-30 03:55:51
Message-ID: 799.1001822151@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Russ McBride <Russ(at)psyex(dot)com> writes:
> Typing "/usr/local/pgsql/bin/psql -h localhost testdb" starts up my 
> database in psql quite nicely, which seems to indicate to me that the 
> pg_hba.conf is being read and the line:

> local  all                        trust
> is working as expected (I assume that this is the line that allows 
> all local UNIX socket connections).

You assume wrong: "-h localhost" triggers a connection over IP, not
over UNIX sockets.  Specifically, it's going to match the pg_hba.conf
line that mentions 127.0.0.1.

At this point I think your problem is that your JDBC setup is trying
to connect to your machine by name, not by the "localhost" alias,
and this results in a connection via your current network IP address
rather than the 127.0.0.1 loopback address.  Since you have an entry
in pg_hba.conf for 127.0.0.1 and not the other address, only the
localhost address will work.

			regards, tom lane

In response to

Responses

pgsql-admin by date

Next:From: Russ McBrideDate: 2001-09-30 03:56:29
Subject: Re: authentication problems
Previous:From: Russ McBrideDate: 2001-09-30 03:29:47
Subject: Re: authentication problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group