Re: disallowed characters in table names?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Lefevre <lefevre(dot)10(at)osu(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: disallowed characters in table names?
Date: 2007-06-11 02:00:00
Message-ID: 20764.1181527200@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Steve Lefevre <lefevre(dot)10(at)osu(dot)edu> writes:
> Can someone point me to a resource where I can find the disallowed
> characters in Postgres database, table, and field names?

http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

For an unquoted name, it's basically a-z, underscore, plus any and
all non-ASCII characters, plus digits and $ after the first character.
The nitty-gritty is the flex definition:

ident_start [A-Za-z\200-\377_]
ident_cont [A-Za-z\200-\377_0-9\$]
identifier {ident_start}{ident_cont}*

Quoted names allow anything at all except \0.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David Monarchi 2007-06-11 14:17:43 query plan and the use of indexes
Previous Message Michael Glaesemann 2007-06-11 01:52:05 Re: disallowed characters in table names?