Problems changing password through JDBC

From: afgag(at)metroweb(dot)co(dot)za
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problems changing password through JDBC
Date: 2006-10-30 09:51:04
Message-ID: 1079.130.88.16.231.1162201864.squirrel@airmail.metroweb.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi

I'm busy developing a client to communicate to a PostgreSQL 8.1 server
running on a Windows XP machine. I have written the client in Java using
the PostgreSQL JDBC 3 drivers.

Part of the client's functionality is to allow the user to change his or
her PostgreSQL login password, but here I have run into some strange
behaviour.

At the moment, the PostgreSQL server is accepting only logins which
provide the password in plain text: no encryption is used at all. When I
log into the server using a client such as psql and issue the SQL command
ALTER ROLE bob WITH PASSWORD 'bobette' (for example), all is fine and at
the next login (either from psql or my client) the user bob has to give
the password bobette.

However, when I issue the same command from within my client and send it
using JDBC, I don't get any errors but all subsequent login attempts (both
on psql and my client) by bob fail no matter what password is given:
PostgreSQL tells me the password is wrong. It is almost as if the
password in the pg_authid table gets corrupted.

To test whether this was in fact happening, I changed the SQL in my client
to ALTER ROLE bob WITH UNENCRYPTED PASSWORD 'bobette' and then monitored
the password field in pg_authid from pgAdmin. The password was correctly
changed, but again all login attempts both via psql and the client failed
with an incorrect password message.

I've done some digging, but so far I have found no posts about this kind
of problem. Also don't really know which mailing list to send it to.

If anyone has any ideas I sure would appreciate it!

Thanks

Jacques

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Goodenough 2006-10-30 11:17:52 confused about transactions and connection pools
Previous Message Michael Paesold 2006-10-30 08:09:46 Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails