On Fri, Apr 8, 2011 at 10:11 AM, Grzegorz Szpetkowski
<gszpetkowski@gmail.com> wrote:
> Since USER is reserved PostgreSQL keywords should I generally avoid
> such names ?
I would avoid creating user names and other identifiers (names of
functions, schemas, databases, tables, etc.) which collide with
reserved words.
> I found that I can even create (distinct) "USER" role:
>
> createuser -SdR USER
> psql -c "\du"
> List of roles
> Role name | Attributes | Member of
> -----------+-----------------------------------+-----------
> USER | Create DB | {}
> postgres | Superuser, Create role, Create DB | {}
> user | Create DB | {}
Yup; from:
<http://www.postgresql.org/docs/9.0/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS>
"Quoting an identifier also makes it case-sensitive, whereas
unquoted names are always folded to lower case."
Josh