Re: psql -c "select * from a-user-name-that-exist fails

From: lalebarde <l(dot)alebarde(at)free(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: psql -c "select * from a-user-name-that-exist fails
Date: 2010-09-24 09:35:38
Message-ID: 1285320938237-2852359.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Hi Josh,
Thanks for your help. I have recreated the user laurent with :
$ createuser -S -d -l -P -E -U postgres laurent
from the postgres linux user.

From the documentation, I should be able to login since LOGIN is default for
createuser and for the case, I force it with -l. But I just cannot login :
$ createdb -U laurent mydb -W
Mot de passe :
createdb : n'a pas pu se connecter à la base de données postgres : n'a pas
pu se connecter au serveur : Permission non accordée
Le serveur est-il actif localement et accepte-t-il les connexions sur la
socket Unix « /var/run/postgresql/.s.PGSQL.5432 » ?

Which translate to :
createdb: could not connect to database postgres: could not connect to
server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I am in the pg_user view :
postgres=# SELECT usename FROM pg_user;
usename
----------
postgres
laurent
(2 lignes)

and the pg_role one :
postgres=# SELECT rolname FROM pg_roles;
rolname
----------
postgres
laurent
(2 lignes)

My pg_hba.conf is not a showstopper :
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust

Now for your checks :
postgres=# SELECT rolcanlogin FROM pg_authid WHERE rolname = 'laurent';
rolcanlogin
-------------
t
(1 ligne)
So it looks ok, isn't it ?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/psql-c-select-from-a-user-name-that-exist-fails-tp2852042p2852359.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message lalebarde 2010-09-24 12:54:17 Re: psql -c "select * from a-user-name-that-exist fails
Previous Message Josh Kupershmidt 2010-09-24 00:45:04 Re: psql -c "select * from a-user-name-that-exist fails