Re: BUG #2224: unlogical syntax error

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Hervé Hénoch <h(dot)henoch(at)isc84(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2224: unlogical syntax error
Date: 2006-01-30 17:12:22
Message-ID: 20060130171222.GA55039@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Clifford Wolf 2006-01-30 17:23:47 Re: [Sd-log] Re: Endless loop in ExecNestLoop
Previous Message Philipp Reisner 2006-01-30 16:46:49 Endless loop in ExecNestLoop