Re: implicit vs. explicit RETURN when OUT is used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: implicit vs. explicit RETURN when OUT is used
Date: 2008-01-06 07:47:17
Message-ID: 15859.1199605637@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivan Sergio Borgonovo <mail(at)webthatworks(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo 2008-01-06 11:06:38 Re: Performance problem. Could it be related to 8.3-beta4?
Previous Message Scott Marlowe 2008-01-05 21:12:22 Re: Performance problem. Could it be related to 8.3-beta4?