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

Re: [INTERFACES] (Yet another) unable to connect w/ JDBC via hostname

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Mark Dzmura <mdz(at)phalanx(dot)phalanx(dot)net>, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] (Yet another) unable to connect w/ JDBC via hostname
Date: 1999-07-28 12:01:11
Message-ID: l03130301b3c4a09ae327@[] (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
At 20:45 +0300 on 27/07/1999, Mark Dzmura wrote:

> 4. The access file, pg_hba.conf contains the following line:
>    host         all     ident     sameuser
>    The intention is to allow any host on the local network to
>    access any database using "ident" validation semantics (unix users).
> 5. The database was stopped and started after making these changes.
> 6. The following Java code tries to open a connection (in both
>    the working and non-working cases):
>    Connection db = DriverManager.getConnection(dbURL,
>               user,
>               pass);
>  The user and pass strings are a valid unix user and password,
>  and the user has full access to the database in question.
>  As mentioned above, This call throws an exception if dbURL is
>  fully qualified (even if the machine name is the localhost),
>  but NOT if it refers to a local database.

1. Does identd run on your system?

2. Is the user you pass to the connection the same as the one that
   actually runs the program? This is important, because you asked
   Postgres to check by Ident that the user who tries to connect is
   indeed who he says he is (hence "sameuser").

   Since you didn't show the pg_hba.conf line that pertains to
   localhost (, I assume that it uses 'trust'. This would
   explain the differences in behaviour.

BTW, if you use ident, you may as well pass an empty password. It is not


Herouth Maoz, Internet developer.
Open University of Israel - Telem project

In response to

pgsql-interfaces by date

Next:From: Tom LaneDate: 1999-07-28 14:04:20
Subject: Re: [INTERFACES] libpq problem (really libpq feature request)
Previous:From: Jonathan davisDate: 1999-07-28 10:06:03
Subject: Re: [INTERFACES] libpq problem (really libpq feature request)

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