mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Revert "Move portal pinning from PL/pgSQL to SPI"
This reverts commit b3617cdfbb
.
This broke returning unnamed cursors from PL/pgSQL functions.
Apparently, there are no test cases for this.
This commit is contained in:
@ -1175,12 +1175,6 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan,
|
||||
{
|
||||
/* Use a random nonconflicting name */
|
||||
portal = CreateNewPortal();
|
||||
|
||||
/*
|
||||
* Make sure the portal doesn't get closed by the user statements we
|
||||
* execute.
|
||||
*/
|
||||
PinPortal(portal);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1419,9 +1413,6 @@ SPI_cursor_close(Portal portal)
|
||||
if (!PortalIsValid(portal))
|
||||
elog(ERROR, "invalid portal in SPI cursor operation");
|
||||
|
||||
if (portal->portalPinned)
|
||||
UnpinPortal(portal);
|
||||
|
||||
PortalDrop(portal, false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user