Thread: [libpq] Password authentication failed for user

[libpq] Password authentication failed for user

From
Torsten Mager
Date:
Hello!

I have two different programs written in C. Both programs are compilied 
and linked to the same liqpq. Postgresql-7.4.7 is installed and used.

In both programs similar connections to the same database are made over 
network. On the server runs postgresql-7.3.4.

In one case everything is ok and the connection to the database works.

The other program does not work fine, the error-message "Password 
authentication failed for user" appears. If i change the configuration 
of the server in "pg_hba.conf" from "md5" to "password", everything 
works fine too.

What is the problem?!?


Re: [libpq] Password authentication failed for user

From
Michael Fuhr
Date:
On Thu, Jan 12, 2006 at 02:53:53PM +0100, Torsten Mager wrote:
> In one case everything is ok and the connection to the database works.
> 
> The other program does not work fine, the error-message "Password 
> authentication failed for user" appears. If i change the configuration 
> of the server in "pg_hba.conf" from "md5" to "password", everything 
> works fine too.
> 
> What is the problem?!?

What's different about how the two programs connect to the database?
Apparently something's different; figure out what that is and you'll
be closer to finding the problem.

Are the programs connecting to the same database (not just to the
same server, but to the same database on that server)?  Are they
connecting as the same user?

-- 
Michael Fuhr