Re: implicit vs. explicit RETURN when OUT is used - Mailing list pgsql-general

From Tom Lane
Subject Re: implicit vs. explicit RETURN when OUT is used
Date
Msg-id 15859.1199605637@sss.pgh.pa.us
Whole thread Raw
In response to implicit vs. explicit RETURN when OUT is used  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: implicit vs. explicit RETURN when OUT is used  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> But when I switch to
> select into _BasketID1,_BasketID2 _BasketID1,_BasketID2 from testA();
> nothing get back from testB().

I think you've forgotten that plpgsql variables will be substituted
for, wherever they appear.  The above is just an extremely expensive
form of
    _BasketID1 := _BasketID1;
    _BasketID2 := _BasketID2;
ie, a big no-op.

The general rule of thumb is not to name plpgsql parameters or variables
the same as fields you'll need to reference in the queries in the
function.

            regards, tom lane

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Performance problem. Could it be related to 8.3-beta4?
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: implicit vs. explicit RETURN when OUT is used