Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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