Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aB1NH-0000Rp-Gj for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Dec 2015 14:23:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aB1NH-0001no-3W for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Dec 2015 14:23:43 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aB1Md-0000No-Nh for pgsql-bugs@postgresql.org; Mon, 21 Dec 2015 14:23:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aB1Ma-0000I5-Uo for pgsql-bugs@postgresql.org; Mon, 21 Dec 2015 14:23:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tBLEMxT1021220; Mon, 21 Dec 2015 09:22:59 -0500 From: Tom Lane To: Emma Saurus cc: pgsql-bugs@postgresql.org Subject: Re: Cannot log in as newly created user In-reply-to: <56753C01.105@westnet.com.au> References: <56753C01.105@westnet.com.au> Comments: In-reply-to Emma Saurus message dated "Sat, 19 Dec 2015 19:14:09 +0800" Date: Mon, 21 Dec 2015 09:22:59 -0500 Message-ID: <21219.1450707779@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Emma Saurus 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