Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com> writes:
>> Consider
>> srf(foo(col))
>> where foo returns a pass-by-reference datatype.
> Yeah this is my basic confusion. But wouldn't the arguments be
> evaluated afresh on the subsequent call for this SRF?
No, see ExecMakeFunctionResult(). If we did that we'd have serious
problems with volatile functions, ie srf(random()).
regards, tom lane