Re: BUG #5431: CREATE USER is not case sensitive, but psql command line arguments are - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #5431: CREATE USER is not case sensitive, but psql command line arguments are
Date
Msg-id 20100419202037.GL6733@alvh.no-ip.org
Whole thread Raw
In response to BUG #5431: CREATE USER is not case sensitive, but psql command line arguments are  ("Evan Nelson" <ean5533@gmail.com>)
Responses Re: BUG #5431: CREATE USER is not case sensitive, but psql command line arguments are  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
Evan Nelson escribió:
>
> The following bug has been logged online:
>
> Bug reference:      5431
> Logged by:          Evan Nelson
> Email address:      ean5533@gmail.com
> PostgreSQL version: 8.4
> Operating system:   Ubuntu 9.10
> Description:        CREATE USER is not case sensitive, but psql command line
> arguments are
> Details:
>
> When creating a user (via CREATE USER/ROLE), the username you choose is not
> case sensitive (e.g. "nEWuSer" is saved as "newuser"). However, the command
> line arguments for psql ARE case sensitive. This means that if I create a
> user like "newUser", then try to log into postgres via psql as "newUser",
> I'll be told the the role doesn't exist. Then, when I log into postgres as
> an existing user and try to re-create the role "newUser", postgres will tell
> me that the role already exists -- a frustrating cycle.

Right.  This is because of a mixture of trying to adhere to the SQL
standard (which mandates that unquoted identifiers are case-folded) and
convenience of usafe of the shell command line.  The strict solution would
be to case-fold unquoted identifiers passed as arguments to psql, so
you'd be required to type something like
psql \"nEWuSer\"
to be able to log in as such a user -- otherwise the quotes would be
stripped by the shell.  However, this is so inconvenient that it has
been dumped in favor of not doing case-folding of idenfiers in shell
command line arguments, regardless of quoting.

In short, not a bug ...

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: bugs that have not been replied-to on list
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5431: CREATE USER is not case sensitive, but psql command line arguments are