Thomas Hallgren <thhal(at)mailblocks(dot)com> writes:
> Would such a patch be accepted?
Seems like a brute-force solution. I'd look first at whether
AtCommit_Portals could just restart its hashtable scan after
each deletion; if that seems too inefficient, modify the hash
table entries themselves to carry a "portal already deleted"
flag.
regards, tom lane