HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

PostgreSQL user can not connect to server after changing password

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlaftercanconnectuserpasswordserverchangingnot

Problem

I've met this with 4 roles I created:

After changing password for a user in pgAdmin III using the GUI (1), that user can not log in any more.

pgAdmin III show error message:

An error has occurred:

Error connecting to the server: FATAL:  password authentication failed for user "sam"
FATAL:  password authentication failed for user "sam"


My system: Postgresql 9.2 on Ubuntu 12.04

Is there any way to fix this?

(1): login with account postgres, right click user in Login Roles, go to tab 'Definition' and enter password

Solution

It's possible that you're being bitten by this PgAdmin bug (changelog):


2012-11-28 AV 1.16.1 Date picker controls returns a full timestamp
by
default, which can cause inadvertent date changes
on jobs and role validty dates. Ignore the time part.

This bug has been seen to set password expiry dates far in the past, such as 1/1/1970. In this case the error message when trying to connect is no different than with a wrong password.

You can check these expiry dates with:

SELECT usename,valuntil FROM pg_user;


and if they're wrong, reset them with:

ALTER USER username VALID UNTIL 'infinity';


and upgrade pgAdmin.

Code Snippets

SELECT usename,valuntil FROM pg_user;
ALTER USER username VALID UNTIL 'infinity';

Context

StackExchange Database Administrators Q#36137, answer score: 16

Revisions (0)

No revisions yet.