Re: PLPGSQL and FOUND stange behaviour after EXECUTE - Mailing list pgsql-bugs

From Neil Conway
Subject Re: PLPGSQL and FOUND stange behaviour after EXECUTE
Date
Msg-id 1096607254.9055.10.camel@localhost.localdomain
Whole thread Raw
In response to Re: PLPGSQL and FOUND stange behaviour after EXECUTE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PLPGSQL and FOUND stange behaviour after EXECUTE
List pgsql-bugs
On Fri, 2004-10-01 at 13:39, Tom Lane wrote:
> Possibly not.  Can EXECUTE determine how the executed statement would
> have set the flag?

At the moment, EXECUTE just feeds the string it finds to spi_execute().
We could probably hack it to figure out how to modify FOUND, but I think
it would be ugly. One way to fix this would be to reimplement EXECUTE to
be essentially `eval': it would take an arbitrary string and execute it
as a PL/pgSQL statement. That would fix the FOUND problem, and also give
us EXECUTE INTO in one fell swoop. (Rather than reimplementing EXECUTE,
we might want to add this functionality as a new command -- "EVAL" might
be a good name for it.)

> Should we assume that the function doing the EXECUTE
> knows exactly what it's executing and what the implications on FOUND
> ought to be?

I think it's reasonable to assume that the application developer knows
this much.

-Neil

pgsql-bugs by date:

Previous
From: Neil Conway
Date:
Subject: Re: semicolon not required on END statement
Next
From: Tom Lane
Date:
Subject: Re: PLPGSQL and FOUND stange behaviour after EXECUTE