Re: Error with word 'desc' - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Error with word 'desc'
Date
Msg-id 20030624074956.S4481-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Error with word 'desc'  ("Reuben D. Budiardja" <techlist@voyager.phys.utk.edu>)
List pgsql-general
On Tue, 24 Jun 2003, Reuben D. Budiardja wrote:

> Hi,
> Seems that everytime I use the word 'desc' I got an error. For example, this
> query:
> SELECT code, desc FROM or_code_table WHERE tr = 'FORMAT'
> gave me
> ERROR:  parser: parse error at or near "desc"
>
> When I created the table I got the same error too. I got around that by
> creating the table using pgaccess instead of using psql console.
>
> Is 'desc' a reserved key word of some kind ? Even if yes (like in mysql or
> oracle), the parser should understand the context in which it's mentioned. I
> don't remember I got that kind of error with mysql / oracle.

Desc is a reserved word.  You'll need to double quote it ("desc") in the
query for it to be legal.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Many Pl/PgSQL parameters -> AllocSetAlloc(128)?
Next
From: "Tim Hawkins"
Date:
Subject: Re: [pgsql-advocacy] Documentation quality WAS: interesting