Run a portal's cleanup hook immediately when pushing it to DONE state.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 6252c4f9e201f619e5eebda12fa867acd4e4200e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2011-03-03T18:04:06Z
Releases: 9.1.0
Run a portal's cleanup hook immediately when pushing it to DONE state.

This works around the problem noted by Yamamoto Takashi in bug #5906,
that there were code paths whereby we could reach AtCleanup_Portals
with a portal's cleanup hook still unexecuted.  The changes I made
a few days ago were intended to prevent that from happening, and
I think that on balance it's still a good thing to avoid, so I don't
want to remove the Assert in AtCleanup_Portals.  Hence do this instead.

Files

PathChange+/−
src/backend/tcop/pquery.c modified +1 −1
src/backend/utils/mmgr/portalmem.c modified +26 −0
src/include/utils/portal.h modified +1 −0