Erro

Lists: Postg토토 커뮤니티SQL: Postg토토 커뮤니티SQL Mailing Lists: pgsql-bugs since 2004-04-28 19:51
From: Aldrey Galindo <aldreygalindo(at)yahoo(dot)com(dot)br>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Erro
Date: 2004-04-28 19:51:32
Message-ID: 20040428195132.70593.qmail@web60205.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토 커뮤니티SQL: Postg토토 커뮤니티SQL Mailing Lists: pgsql-bugs since 2004-04-28 19:51

Hi,
Would like to report a problem that happened with a
friend mine. I was to inquire and I found the
following one.

--
db=# create table teste (desc varchar(50));
ERROR: parser: parse error at or near "desc" at
character 21
db=# create table desc (teste varchar(50));
ERROR: parser: parse error at or near "desc" at
character 14
db=# create table table (teste varchar(50));
ERROR: parser: parse error at or near "table" at
character 14
db=# create table teste (table varchar(50));
ERROR: parser: parse error at or near "table" at
character 21
--

Aldrey

______________________________________________________________________

Yahoo! Messenger - Fale com seus amigos online. Instale agora!
http://br.download.yahoo.com/messenger/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aldrey Galindo <aldreygalindo(at)yahoo(dot)com(dot)br>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Erro
Date: 2004-05-04 05:06:40
Message-ID: 29851.1083647200@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

=?iso-8859-1?q?Aldrey=20Galindo?= <aldreygalindo(at)yahoo(dot)com(dot)br> writes:
> db=# create table teste (desc varchar(50));
> ERROR: parser: parse error at or near "desc" at
> character 21

DESC is a reserved keyword, per the SQL specification.

If you really really want to name your column or table "desc", you can
double-quote the word. But I'd suggest picking another name.

regards, tom lane


From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Aldrey Galindo <aldreygalindo(at)yahoo(dot)com(dot)br>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Erro
Date: 2004-05-04 05:32:22
Message-ID: 20040503222914.Y26988@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Wed, 28 Apr 2004, [iso-8859-1] Aldrey Galindo wrote:

> Hi,
> Would like to report a problem that happened with a
> friend mine. I was to inquire and I found the
> following one.
>
> --
> db=# create table teste (desc varchar(50));
> ERROR: parser: parse error at or near "desc" at
> character 21
> db=# create table table (teste varchar(50));
> ERROR: parser: parse error at or near "table" at
> character 14

DESC and TABLE are reserved words in SQL, so you need to double
quote them to use them as column or table names.