AtCommitPortals (portalmem.c) iterates over the entries in the PortalHashTable. This causes a chain of calls that sometimes reach an ExprContextCallback. If that callback issues a succesfull SPI_cursor_close some problems might lay ahead. As the AcCommitPortals iteration continues, it sometimes encounter a deleted portal and elogs with an error stating "trying to delete portal name that does not exist".
Regards, Thomas Hallgren
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend