Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> The trivial fix is to reset the per-tuple memory context between
> iterations.
Have you tested this with SRFs?
ForeignNext seems like quite the wrong place for resetting
exprcontext in any case ...
regards, tom lane