| From: | "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com> | 
|---|---|
| To: | pgsql-novice(at)postgresql(dot)org | 
| Subject: | Re: psql -c "select * from a-user-name-that-exist fails | 
| Date: | 2010-09-24 14:30:06 | 
| Message-ID: | 20100924163006.5df7a252@anubis.defcon1 | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
On Fri, 24 Sep 2010 06:59:15 -0700 (PDT), lalebarde <l(dot)alebarde(at)free(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jean-Yves F. Barbier | 2010-09-24 14:37:09 | Re: psql -c "select * from a-user-name-that-exist fails | 
| Previous Message | Frank Bax | 2010-09-24 14:03:53 | Re: psql -c "select * from a-user-name-that-exist fails |