Re: jdbc pg_hba.conf error

From: "Bhavana(dot)Rakesh" <Bhavana(dot)Rakesh(at)noaa(dot)gov>
To: gonzales(at)linuxlouis(dot)net
Cc: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: jdbc pg_hba.conf error
Date: 2007-05-30 17:21:02
Message-ID: 465DB27E.9040001@noaa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I have been restarting the postgres every time I make changes to
the pg_hba.conf file.

-Bhavana
On a lighter note, it's a 'she' not 'he'. :) No offense taken. :))

gonzales(at)linuxlouis(dot)net wrote:
> As super-user (postgres) you have to create the user in Postgres, then
> Grant access. In other words, if the pg_hba.conf file specifies a
> user who does not exist, "user brakesh does not exist" will cause a
> failure to connect as well.
>
> Every connection to a database, has to have a user associated with the
> session.
>
> So the fact that he has connected to at least one database, means he's
> gotten far enough to connect and create the proper ID/Authentication.
>
> Actually, I wonder if 'after' he's changed the pg_hba.conf file if
> he's been restarting the postgres process? Which is 'session'
> associated.
>
> Everytime you change the pg_hba.conf file, you have to restart
> postgres, don't you?
>
>
>
> On Wed, 30 May 2007, Oliver Elphick wrote:
>
>> On Wed, 2007-05-30 at 13:00 -0400, gonzales(at)linuxlouis(dot)net wrote:
>>> Did you grant access to your user?
>>
>> If you mean grant access by an SQL GRANT, he hasn't got far enough to
>> check that. The error specifically says "no pg_hba.conf entry". As far
>> as I can see, his pg_hba.conf is OK.
>>
>>>
>>> On Wed, 30 May 2007, Oliver Elphick wrote:
>>>
>>>> On Wed, 2007-05-30 at 18:35 +0200, Martijn van Oosterhout wrote:
>>>>> On Wed, May 30, 2007 at 12:30:38PM -0400, Bhavana.Rakesh wrote:
>>>>>> Oliver,
>>>>>>
>>>>>> When I do a :
>>>>>> psql -p 5000 testing123
>>>>>> I can make a connection. 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
>>>>>
>>>>> Ofcourse, the first connection is a local connection, which you
>>>>> obviously have configured. The latter connects to localhost, which
>>>>> you
>>>>> havn't configured.
>>>>
>>>> His original message (which I snipped) said he had:
>>>>
>>>> # IPv4-style local connections:
>>>> host all all 127.0.0.1 255.255.255.255
>>>> trust
>>>> host testing123 brakesh 127.0.0.1 255.255.255.255
>>>> trust
>>>>
>>>> So it seems to me he did have it configured.
>>>>
>>>> In fact the first host line should be used and the second one for user
>>>> brakesh is redundant, since it comes later in the file. The only
>>>> thing
>>>> I can see is that it might be related to SSL.
>>>>
>>>>
>>>>
>>>
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-05-30 17:28:18 Re: jdbc pg_hba.conf error
Previous Message gonzales 2007-05-30 17:13:56 Re: jdbc pg_hba.conf error