Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)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