Обсуждение: Probelm creating a table

Поиск
Список
Период
Сортировка

Probelm creating a table

От
Dave Smith
Дата:
Tried to create a table...

create table global (direct_key char(2));
Got ..
ERROR:  parser: parse error at or near "global"

A quick peruse of the docs does not show global as a reserved word in
the CREATE TABLE syntax. Could someone explain this to me.

--
Dave Smith
Candata Systems Ltd.
(416) 493-9020
dave@candata.com

Re: Probelm creating a table

От
John McKown
Дата:
On page 12 of the User's Guide, it states that "global" is a reserved word
which can be used as a column label, but not as an identifier. I guess
this would include a table name as an identifier.

John McKown

On Wed, 23 Aug 2000, Dave Smith wrote:

> Tried to create a table...
>
> create table global (direct_key char(2));
> Got ..
> ERROR:  parser: parse error at or near "global"
>
> A quick peruse of the docs does not show global as a reserved word in
> the CREATE TABLE syntax. Could someone explain this to me.
>
>


Re: Probelm creating a table

От
sridhvenk@yahoo.com
Дата:
"global" is indeed a postgres keyword

refer Postgres User's Guide Chapter 2-"SQL Syntax" in the section Key
words".


The following section gives the answer

The following are Postgres reserved words which are also SQL92 or SQL3
reserved words, and which are allowed to be present as column labels, but
not as identifiers:





On Wed, 23 Aug 2000, Dave Smith wrote:

CASE COALESCE CROSS CURRENT ELSE END FALSE FOREIGN GLOBAL GROUP LOCAL
NULLIF ORDER POSITION PRECISION TABLE THEN TRANSACTION TRUE
WHEN


Regards Sridhar