Andres Freund <andres(at)anarazel(dot)de> writes:
> I've just played around with this. ValuePerCall SRFs are fine with
> called in a short-lived context (they're required to be able to, as
> documented in xfunc.sgml), so is SFRM_Materialize. The only thing to be
> careful about is the *arguments* to the function, those need to live
> long enough in the ValuePerCall case.
Isn't there already code to deal with that? See around line 175
in execSRF.c.
regards, tom lane