Re: PL/pgSQL: FOUND not set by EXECUTE?

From: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
To: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/pgSQL: FOUND not set by EXECUTE?
Date: 2004-05-25 12:20:36
Message-ID: 20040525122036.GA2342@campbell-lange.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 24/05/04, Brendan Jurd (blakjak(at)blakjak(dot)sytes(dot)net) wrote:
> I've discovered that in 7.4.2 PL/pgSQL, the FOUND variable is not at all
> affected by use of the EXECUTE command, even if the statement you pass
> to EXECUTE would set FOUND to true when run directly. The documentation
> doesn't really point this out, and in my opinion, it's an unintuitive
> behaviour. Why would executing the command dynamically make a
> difference to how FOUND is treated? The statement still "happens" in
> the end, additional query plan or no.

"FOUND is a local variable; any changes to it affect only the current
PL/pgSQL function."

HTML manual reference:

plpgsql-statements.html#PLPGSQL-STATEMENTS-PERFORM

Rory

--
Rory Campbell-Lange
<rory(at)campbell-lange(dot)net>
<www.campbell-lange.net>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Lester 2004-05-25 12:45:02 Re: Abnormal Exit Quandary
Previous Message Stéphane Pinel 2004-05-25 11:54:44 [OFF] PostgreSQL Logo in EPS ?