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.