Re: BUG #1485: upper case user names / creatuser

From: Richard Huxton <dev(at)archonet(dot)com>
To: Hannes Erven <h(dot)e(at)gmx(dot)at>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1485: upper case user names / creatuser
Date: 2005-02-21 14:02:43
Message-ID: 4219EA03.8030302@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hannes Erven wrote:
> The following bug has been logged online:
>
> Bug reference: 1485
> Logged by: Hannes Erven
> Email address: h(dot)e(at)gmx(dot)at
> PostgreSQL version: 7.4.7
> Operating system: 2.6.10-gentoo-r6
> Description: upper case user names / creatuser
> Details:

> template1=# alter user Hannes password '***';
> ERROR: user "hannes" does not exist

> I then created another user, 'hannes', with createuser, and then I was able
> to alter the passwords, altough I now had two users in pg_user: hannes and
> Hannes.

The rules for SQL are: unquoted names get folded to lower case,
double-quoted names are left alone. The error message shows this - it
says "hannes" doesn't exist.

You could argue that the command-line tools should fold to lower-case
too, but that's not standard behaviour for command-line tools.

So - all you need to do is issue SQL like:
ALTER USER "Hannes" ...

Personally, I keep all objects and users lower-case only, it makes my
life easier.
--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Juu 2005-02-21 14:05:38 Re: problem installing postgresql-8.0.1 on Windows 2K
Previous Message Ludwig Lim 2005-02-21 13:56:45 BUG #1494: psql \df to_char