Re: A question about PL/pgSQL DECLAREd variable behavior - Mailing list pgsql-general

From Jim Nasby
Subject Re: A question about PL/pgSQL DECLAREd variable behavior
Date
Msg-id 562A5AE7.8030507@BlueTreble.com
Whole thread Raw
In response to Re: A question about PL/pgSQL DECLAREd variable behavior  (Dane Foster <studdugie@gmail.com>)
Responses Re: A question about PL/pgSQL DECLAREd variable behavior  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
On 10/22/15 8:52 PM, Dane Foster wrote:
> It just occurred to me that another option, for my specific example,
> would be to record/cache FOUND instead of testing the RECORD variable
> for its NULLness. Unless of course assigning FOUND to a variable is a
> pass-by-reference assignment, which in the actual code that I'm writing
> would be problematic because FOUND is set many times because there are
> at least 4 SQL commands that my function executes.

AFAIK, functions don't really do pass by reference, except for INOUT
parameters. In any case, FOUND is definitely reset when you do things
like SELECT INTO.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


pgsql-general by date:

Previous
From: "Day, David"
Date:
Subject: Re: strange connection problem.
Next
From: Pavel Stehule
Date:
Subject: Re: A question about PL/pgSQL DECLAREd variable behavior