0

I created a user named 'client', witch refuses to connect. Here's my client:

CREATE ROLE client LOGIN
  ENCRYPTED PASSWORD 'md5d5bc32b75da65fe60067f501a4bb6665'
  NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL '1970-01-01 00:00:00';
GRANT viewers TO client;

Here's how I changed his password:

ALTER USER client PASSWORD 'client';

Here's how I fail to connect:

psql -h localhost -d core -U client
Password for user client: 
psql: FATAL:  password authentication failed for user "client"
FATAL:  password authentication failed for user "client"

What have I done wrong? (I did tried restarting)

Just in case there are some more dumps:

viewers group:

CREATE ROLE viewers LOGIN
  NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL '1970-01-01 00:00:00';

core database

CREATE DATABASE core
  WITH OWNER = postgres
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'en_US.UTF-8'
       LC_CTYPE = 'en_US.UTF-8'
       CONNECTION LIMIT = -1;
GRANT CONNECT, TEMPORARY ON DATABASE core TO public;
GRANT ALL ON DATABASE core TO postgres;
GRANT CONNECT, TEMPORARY ON DATABASE core TO viewers;
9
  • recommended way for changing password is #\password user Nov 25, 2014 at 21:07
  • I just did, it did not help, result is the same
    – Ben
    Nov 25, 2014 at 21:11
  • I am curious if it's refusing to let you log in because of your VALID UNTIL clause.. I have not used it, personally - so it's only a suspicion. Nov 25, 2014 at 21:12
  • I did not set It, it was set by default. I got this user dump from pgadmin
    – Ben
    Nov 25, 2014 at 21:14
  • Could it be something with group viewers? @JoishiBodio
    – Ben
    Nov 25, 2014 at 21:15

1 Answer 1

1

Issue ALTER ROLE client VALID UNTIL 'infinity' and it will remove the VALID UNTIL clause.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.