Re: BUG #2224: unlogical syntax error - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: BUG #2224: unlogical syntax error
Date
Msg-id 20060130171222.GA55039@winnie.fuhr.org
Whole thread Raw
In response to BUG #2224: unlogical syntax error  ("Hervé Hénoch" <h.henoch@isc84.org>)
List pgsql-bugs
On Mon, Jan 30, 2006 at 10:47:10AM +0000, Herv Hnoch wrote:
> CETLOG:  statement: PREPARE <unnamed> AS SELECT adm_pat."nip", id_caisse
> caisse FROM adm_pat  WHERE nip = '20020523'
>
> CETERROR:  syntax error at or near "caisse" at character 33

Are you writing this query or is JDBC generating it?  The AS keyword
is required for column aliases; its absence is causing the syntax
error.

test=> CREATE TABLE foo (abc text);
test=> SELECT abc AS xyz FROM foo;
 xyz
-----
(0 rows)

test=> SELECT abc xyz FROM foo;
ERROR:  syntax error at or near "xyz" at character 12
LINE 1: SELECT abc xyz FROM foo;
                   ^

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Endless loop in ExecNestLoop
Next
From: David Fetter
Date:
Subject: Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...