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

From Michael Fuhr
Subject Re: BUG #2224: unlogical syntax error
Date
Msg-id 20060131203730.GA77058@winnie.fuhr.org
Whole thread Raw
In response to BUG #2224: unlogical syntax error  ("Hervé Hénoch" <h.henoch@isc84.org>)
List pgsql-bugs
[Please copy the mailing list on replies.]

On Tue, Jan 31, 2006 at 08:53:44AM +0100, Hnoch Herv wrote:
> Thank for you response .... I have never written this query : I think it
> is JDBC that have generated it ... My query (written by me) is :
>
>    select id_caisse as caisse from FROM adm_pat WHERE nip = '20020523'
>
> I know I have to use "as" statement ... I'd never disturb you for a
> simple syntax error ...

The above query does have a syntax error ("from FROM"), although
the query in your original report looked correct.

> Jdbc version :  jdbc3 8.1.404

I downloaded postgresql-8.1-404.jdbc3.jar onto a Solaris 9 box
running PostgreSQL 8.1.2 and wrote a test program to run your
original query:

select id_caisse as caisse from adm_pat where nip = '20020523'

The query ran successfully and logged the following:

LOG:  statement: PREPARE <unnamed> AS select id_caisse as caisse from adm_pat where nip = '20020523'
LOG:  statement: <BIND>
LOG:  statement: EXECUTE <unnamed>  [PREPARE:  select id_caisse as caisse from adm_pat where nip = '20020523']

> The very stange think is, if I write :
>
>    select nip, id_caisse as caisse from FROM adm_pat WHERE nip = '20020523'
>
> There is no syntax error !!!!!

There should be a syntax error due to "from FROM"; please post the
actual queries you're running.  It might also be helpful if you
could post a simple but complete program so we can see everything
you're doing.  You might also try asking in the pgsql-jdbc list to
see if anybody there has heard of this problem.

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: Clifford Wolf
Date:
Subject: Bug in query planer ?
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #2220: PostgreSQL-JDBC 8.1-404 fails to compile with