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