Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> Ok, so while we have a valid resource owner up to here, portal->resonwer
> is NULL.
Yeah, that's what I'm guessing. Given the exposed reference to a cursor
WITH HOLD, it seems likely that the reason the portal has no resowner
is that PreCommit_Portals() got rid of it when the cursor was held.
However, if that were the explanation, it's not clear how come this
isn't falling over all the time for everybody who uses holdable cursors.
Any cache flush happening just before fetching from a holdable cursor
ought to do it ...
(Wanders away wondering just how much the regression tests exercise
holdable cursors.)
regards, tom lane