Re: psql -c "select * from a-user-name-that-exist fails - Mailing list pgsql-novice

From Jean-Yves F. Barbier
Subject Re: psql -c "select * from a-user-name-that-exist fails
Date
Msg-id 20100924163006.5df7a252@anubis.defcon1
Whole thread Raw
In response to Re: psql -c "select * from a-user-name-that-exist fails  (lalebarde <l.alebarde@free.fr>)
List pgsql-novice
On Fri, 24 Sep 2010 06:59:15 -0700 (PDT), lalebarde <l.alebarde@free.fr>
wrote:

Yeah, as a matter of fact, I just tested and had this PB:

$ createuser test -W     => Cd line, as postgres, p/w='test'
  (Can create DBs + roles)
$ createdb -O test test  => Cd line, as postgres
$ psql -U test -d test   => Auth by p/w failed (!)

the 1st solution I found was to log into 'test' DB as postgres and:
ALTER USER test WITH PASSWORD 'test';
then the connexion was Ok.

As the error msg was:
psql: FATAL:  authentication by password failed for user << test >>
I tested into 'pg_hba.conf' and finally found I must have:
local   test   test        trust
into it to log w/o any trick (but it don't ask for a p/w.)

So, for security reasons I'll keep the 1st solution.

> I could connect only with the postgres role.
>
> To answer your requests :
> # which createdb
> /usr/bin/createdb
> # which createuser
> /usr/bin/createuser
> # createdb --version
> createdb (PostgreSQL) 8.4.4
> # createuser --version
> createuser (PostgreSQL) 8.4.4


--
A fool and his honey are soon parted.

pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: Re: psql -c "select * from a-user-name-that-exist fails
Next
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: psql -c "select * from a-user-name-that-exist fails