"EXECUTE ... into var" doesn't set FOUND: bug or feature?

Started by Louis-David Mitterrandover 15 years ago5 messagesgeneral
Jump to latest
#1Louis-David Mitterrand
vindex+lists-pgsql-general@apartia.org

Hi,

I noticed that in a pl/pgsql function FOUND is not set after an

EXECUTE ... into var;

Bug or feature?

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Louis-David Mitterrand (#1)
Re: "EXECUTE ... into var" doesn't set FOUND: bug or feature?

Hello

2010/9/16 Louis-David Mitterrand <vindex+lists-pgsql-general@apartia.org>:

Hi,

I noticed that in a pl/pgsql function FOUND is not set after an

       EXECUTE ... into var;

Bug or feature?

feature :(

use a GET DIAGNOSTICS statement instead

Regards

Pavel Stehule

Show quoted text

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Louis-David Mitterrand (#1)
Re: "EXECUTE ... into var" doesn't set FOUND: bug or feature?

Louis-David Mitterrand <vindex+lists-pgsql-general@apartia.org> writes:

I noticed that in a pl/pgsql function FOUND is not set after an
EXECUTE ... into var;
Bug or feature?

It's behaving as documented:
http://www.postgresql.org/docs/9.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

Adding EXECUTE to the list of statements that change FOUND would have a
rather large risk of breaking existing plpgsql functions, IMO.

regards, tom lane

#4Louis-David Mitterrand
vindex+lists-pgsql-general@apartia.org
In reply to: Tom Lane (#3)
Re: "EXECUTE ... into var" doesn't set FOUND: bug or feature?

On Thu, Sep 16, 2010 at 10:12:57AM -0400, Tom Lane wrote:

Louis-David Mitterrand <vindex+lists-pgsql-general@apartia.org> writes:

I noticed that in a pl/pgsql function FOUND is not set after an
EXECUTE ... into var;
Bug or feature?

It's behaving as documented:
http://www.postgresql.org/docs/9.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

Adding EXECUTE to the list of statements that change FOUND would have a
rather large risk of breaking existing plpgsql functions, IMO.

but is really surprising and non-intuitive, given that 'return query
execute' does.

#5Pavel Stehule
pavel.stehule@gmail.com
In reply to: Louis-David Mitterrand (#4)
Re: "EXECUTE ... into var" doesn't set FOUND: bug or feature?

2010/9/16 Louis-David Mitterrand <vindex+lists-pgsql-general@apartia.org>:

On Thu, Sep 16, 2010 at 10:12:57AM -0400, Tom Lane wrote:

Louis-David Mitterrand <vindex+lists-pgsql-general@apartia.org> writes:

I noticed that in a pl/pgsql function FOUND is not set after an
    EXECUTE ... into var;
Bug or feature?

It's behaving as documented:
http://www.postgresql.org/docs/9.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

Adding EXECUTE to the list of statements that change FOUND would have a
rather large risk of breaking existing plpgsql functions, IMO.

but is really surprising and non-intuitive, given that 'return query
execute' does.

RETURN QUERY EXECUTE is a new statement. And it has not original in
PL/SQL so there are not reason to copy misfeature from Oracle.

Regards

Pavel Stehule

Show quoted text

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general