Re: FOR UPDATE is not allowed in this context - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: FOR UPDATE is not allowed in this context
Date
Msg-id 8766.982717138@sss.pgh.pa.us
Whole thread Raw
In response to FOR UPDATE is not allowed in this context  ("Postgres El Mejor" <postgres99@hotmail.com>)
Responses Re: FOR UPDATE is not allowed in this context  (Michael Meskes <meskes@postgresql.org>)
List pgsql-interfaces
"Postgres El Mejor" <postgres99@hotmail.com> writes:
> Greetings:
> When precompiling the following sentence the precompiler shows the message
> "FOR UPDATE is not allowed in this context".

> EXEC SQL SELECT camp_1 INTO :n1 WHERE llave = :var_llave FOR UPDATE;

This seems to me to be a bug in ecpg: the variable ForUpdateNotAllowed
doesn't get reset between statements.  If you experiment more you'll
probably find the behavior depends on the preceding statements.

That bug is gone in 7.1 by virtue of the fact that the variable doesn't
exist anymore ... but I think there are related bugs associated with
some other ad-hoc flags in the ecpg parser, none of which get reset at
what I would consider a reasonable place to reset them ...
        regards, tom lane


pgsql-interfaces by date:

Previous
From: "Postgres El Mejor"
Date:
Subject: FOR UPDATE is not allowed in this context
Next
From: root
Date:
Subject: C++ Question