Thread: No pg_hba.conf entry

No pg_hba.conf entry

From
George Koras
Date:
Hello,

When I try to connect via JDBC to PostgreSQL I get the following error
message:

Error -- Something unusual has occured to cause the driver to fail.
Please report this exception:
java.sql.SQLException: No pg_hba.conf entry for host 143.233.73.254,
user aaa, database bbb

However, the only lines in pg_hba.conf that are not commented out are:

local        all                                         trust
host         all         127.0.0.1     255.255.255.255   trust
host         all         143.233.73.0  255.255.255.0     trust

Isn't this strange? I tried this with both jdbc6.5-1.2.jar and
jdbc7_0-1_2.jar from 143.233.73.254 which runs Linux and from my WinNT
4.0 (sp6) machine and for different databases.

I use PostgreSQL 6.5.2 and before you ask, yes postmaster runs with the
-i option set.

Any comments will be more than welcome.




Re: No pg_hba.conf entry

From
Tom Lane
Date:
George Koras <gkoras@cres.gr> writes:
> java.sql.SQLException: No pg_hba.conf entry for host 143.233.73.254,
> user aaa, database bbb

> However, the only lines in pg_hba.conf that are not commented out are:

> local        all                                         trust
> host         all         127.0.0.1     255.255.255.255   trust
> host         all         143.233.73.0  255.255.255.0     trust

> Isn't this strange?

Yes, very.  Are you sure you and the postmaster are looking at the same
file?  Is there some kind of formatting problem with the file, such as
using non-Unix newlines?  Have you looked at the postmaster log to see
if it gives any more detail?

            regards, tom lane

Re: No pg_hba.conf entry

From
Peter T Mount
Date:
Quoting George Koras <gkoras@cres.gr>:

> Hello,
>
> When I try to connect via JDBC to PostgreSQL I get the following error
> message:
>
> Error -- Something unusual has occured to cause the driver to fail.
> Please report this exception:
> java.sql.SQLException: No pg_hba.conf entry for host 143.233.73.254,
> user aaa, database bbb
>
> However, the only lines in pg_hba.conf that are not commented out are:
>
> local        all                                         trust
> host         all         127.0.0.1     255.255.255.255   trust
> host         all         143.233.73.0  255.255.255.0     trust

Hmmm, that should work...

>
> Isn't this strange? I tried this with both jdbc6.5-1.2.jar and
> jdbc7_0-1_2.jar from 143.233.73.254 which runs Linux and from my WinNT
> 4.0 (sp6) machine and for different databases.
>
> I use PostgreSQL 6.5.2 and before you ask, yes postmaster runs with the
> -i option set.

If you missed -i out you would have got "Connection Refused" not this
Exception. The postmaster is listening, but is refusing the connection for some
reason.

Can you use psql or another interface from 143.233.73.254?

Peter

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

Re: No pg_hba.conf entry

From
George Koras
Date:
Tom Lane <tgl@sss.pgh.pa.us> wrote:
>George Koras <gkoras@cres.gr> writes:
>> java.sql.SQLException: No pg_hba.conf entry for host 143.233.73.254,
>> user aaa, database bbb

>> However, the only lines in pg_hba.conf that are not commented out
are:

>> local        all                                         trust
>> host         all         127.0.0.1     255.255.255.255   trust
>> host         all         143.233.73.0  255.255.255.0     trust

>> Isn't this strange?

>Yes, very.  Are you sure you and the postmaster are looking at the same
file?

Yes, that was exactly the problem! I still have to find out how on earth
we ended up with two sets of configuration files!

Thanks Tom, thanks Peter!