Re: jdbc pg_hba.conf error

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: "Bhavana(dot)Rakesh" <Bhavana(dot)Rakesh(at)noaa(dot)gov>
Cc: pgsql_general <pgsql-general(at)postgresql(dot)org>
Subject: Re: jdbc pg_hba.conf error
Date: 2007-05-30 16:41:14
Message-ID: 1180543274.15764.102.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2007-05-30 at 12:30 -0400, Bhavana.Rakesh wrote:
> Oliver,
>
> When I do a :
> psql -p 5000 testing123
> I can make a connection.

Since you aren't specifying a host (with -h), that command uses a Unix
socket connection and only looks at lines in pg_hba.conf that begin with
"local".

(If you want to do the same in JDBC, make the hostname value blank.)

> However, when I do a
> psql -U brakesh -h 127.0.0.1 -d testing123
>
> I get the followign error:
>
> psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user
> "brakesh", database "testing123", SSL off

What happens if you change "host" to "hostnossl" in pg_hba.conf?
(Seeing that that error message specifies that SSL is off.)
Please remember to SIGHUP or restart the postmaster after changing it.

Again, which version of PostgreSQL is this?

>
> Oliver Elphick wrote:
> > On Wed, 2007-05-30 at 12:11 -0400, Bhavana.Rakesh wrote:
> >
> > > I used the example in the following URL
> > >
> > > http://www.postgresql.org/docs/7.3/static/client-authentication.html
> > >
> >
> > That does have local rather than host, of course.
> >
> > Are you using PostgreSQL 7,3 as well?
> >
> >
> > > Thanks for the catch on "host" instead of "local". I made that
> > > change, and reloaded pgsql.. But I still get the same error. I can
> > > connect to the database using psql client, but my java connection
> > > seems to be failing.
> > >
> >
> > Were you using the exact same parameters for psql?
> >
> > psql -U brakesh -h 127.0.0.1 -d testing123
> >
> >
--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
Do you want to know God? http://www.lfix.co.uk/knowing_god.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2007-05-30 16:46:59 Re: jdbc pg_hba.conf error
Previous Message Martijn van Oosterhout 2007-05-30 16:35:20 Re: jdbc pg_hba.conf error