Re: possible memory leak with SRFs

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikhil Sontakke <nikhil.sontakke@enterprisedb.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-05-06T14:27:09Z
Lists: pgsql-hackers
Nikhil Sontakke <nikhil.sontakke@enterprisedb.com> writes:
> Can someone please explain why we do not reset the expression context
> if an SRF is involved during execution?

Consider
	srf(foo(col))
where foo returns a pass-by-reference datatype.  Your proposed patch
would cut the knees out from under argument values that the SRF could
reasonably expect to still be there on subsequent calls.

			regards, tom lane