Re: Cannot log in as newly created user

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Emma Saurus <emmasaurus(at)westnet(dot)com(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Cannot log in as newly created user
Date: 2015-12-21 14:22:59
Message-ID: 21219.1450707779@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Emma Saurus <emmasaurus(at)westnet(dot)com(dot)au> writes:
> postgres=# CREATE ROLE EmmaChwan CREATEDB LOGIN PASSWORD 'password';
>>> CREATE ROLE
> postgres=# \q

> C:\Users\EmmaChwan>psql
>>> Password:
>>> psql: FATAL: password authentication failed for user "EmmaChwan"

Your problem here is case sensitivity, or lack of it. The unquoted
identifier EmmaChwan is smashed to lower case when seen in a SQL
command, so the actually created user name is "emmachwan". But when
you submit a user (or database) name in a connection request, that's
not SQL language so no quote-stripping or case-folding is done.

You can make it work with

CREATE ROLE "EmmaChwan" ...

but bear in mind you'll have to double-quote that user name *every*
time you refer to it in SQL. The same goes for any other mixed-case
name that you want to be really truly mixed-case and not case-insensitive.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Grzegorz Garlewicz 2015-12-21 15:06:02 Re: BUG #13824: EXISTS sometimes uses seq scan instead of index
Previous Message Greg Clough 2015-12-21 10:44:02 Re: BUG #13770: Extending recovery_min_apply_delay on Standby causes it to be unavailable for a while