Andres Freund <andres(at)anarazel(dot)de> writes:
> It's "just" a MemoryContextSwitchTo() that some idiot^WI forgot and
> reviews didn't spot.
Yeah, I had just come to the same conclusion. I have a fix about ready
to commit, unless you're nearly there ...
regards, tom lane