pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Emma Saurus <emmasaurus@westnet.com.au>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Cannot log in as newly created user
Date: Mon, 21 Dec 2015 09:22:59 -0500
Message-ID: <21219.1450707779@sss.pgh.pa.us> (raw)
In-Reply-To: <56753C01.105@westnet.com.au>
References: <56753C01.105@westnet.com.au>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Emma Saurus <emmasaurus@westnet.com.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <21219.1450707779@sss.pgh.pa.us>
Permalink:  ../21219.1450707779@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21219.1450707779@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, emmasaurus@westnet.com.au
  Subject: Re: Cannot log in as newly created user
  In-Reply-To: <21219.1450707779@sss.pgh.pa.us>
  References: <56753C01.105@westnet.com.au> <21219.1450707779@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox