Skip site navigation (1) Skip section navigation (2)

Re: Valid role name (PostgreSQL 9.0.4)

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Grzegorz Szpetkowski <gszpetkowski(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Valid role name (PostgreSQL 9.0.4)
Date: 2011-04-08 21:39:17
Message-ID: BANLkTin6+r06N+FMeaE3=ujEu8o-hXRpHA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Fri, Apr 8, 2011 at 10:11 AM, Grzegorz Szpetkowski
<gszpetkowski(at)gmail(dot)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

In response to

pgsql-novice by date

Next:From: Saseendra BabuDate: 2011-04-11 08:04:37
Subject: 'Range partitioning in PGSQL'
Previous:From: Grzegorz SzpetkowskiDate: 2011-04-08 14:11:01
Subject: Re: Valid role name (PostgreSQL 9.0.4)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group