aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/portalcmds.c10
-rw-r--r--src/backend/commands/prepare.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c
index ff38e94cb1f..e9771546893 100644
--- a/src/backend/commands/portalcmds.c
+++ b/src/backend/commands/portalcmds.c
@@ -96,7 +96,7 @@ PerformCursorOpen(DeclareCursorStmt *cstmt, ParamListInfo params,
*/
portal = CreatePortal(cstmt->portalname, false, false);
- oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
+ oldContext = MemoryContextSwitchTo(portal->portalContext);
plan = copyObject(plan);
@@ -363,7 +363,7 @@ PersistHoldablePortal(Portal portal)
ActivePortal = portal;
if (portal->resowner)
CurrentResourceOwner = portal->resowner;
- PortalContext = PortalGetHeapMemory(portal);
+ PortalContext = portal->portalContext;
MemoryContextSwitchTo(PortalContext);
@@ -450,10 +450,10 @@ PersistHoldablePortal(Portal portal)
PopActiveSnapshot();
/*
- * We can now release any subsidiary memory of the portal's heap context;
+ * We can now release any subsidiary memory of the portal's context;
* we'll never use it again. The executor already dropped its context,
- * but this will clean up anything that glommed onto the portal's heap via
+ * but this will clean up anything that glommed onto the portal's context via
* PortalContext.
*/
- MemoryContextDeleteChildren(PortalGetHeapMemory(portal));
+ MemoryContextDeleteChildren(portal->portalContext);
}
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c
index 21cb855aeb2..b945b1556a8 100644
--- a/src/backend/commands/prepare.c
+++ b/src/backend/commands/prepare.c
@@ -239,7 +239,7 @@ ExecuteQuery(ExecuteStmt *stmt, IntoClause *intoClause,
portal->visible = false;
/* Copy the plan's saved query string into the portal's memory */
- query_string = MemoryContextStrdup(PortalGetHeapMemory(portal),
+ query_string = MemoryContextStrdup(portal->portalContext,
entry->plansource->query_string);
/* Replan if needed, and increment plan refcount for portal */