diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-12-16 17:26:26 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-01-09 13:47:56 -0500 |
commit | 0f7c49e85518dd846ccd0a044d49a922b9132983 (patch) | |
tree | 1bcbff190de4cc6f8c02e3ecbb2e9b753bbb1ef5 /src/backend/executor/spi.c | |
parent | 3cb1b2a8804da8365fe17f687d96b720df4a583d (diff) | |
download | postgresql-0f7c49e85518dd846ccd0a044d49a922b9132983.tar.gz postgresql-0f7c49e85518dd846ccd0a044d49a922b9132983.zip |
Update portal-related memory context names and API
Rename PortalMemory to TopPortalContext, to avoid confusion with
PortalContext and align naming with similar top-level memory contexts.
Rename PortalData's "heap" field to portalContext. The "heap" naming
seems quite antiquated and confusing. Also get rid of the
PortalGetHeapMemory() macro and access the field directly, which we do
for other portal fields, so this abstraction doesn't buy anything.
Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r-- | src/backend/executor/spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 4d9b51b947b..995f67d2662 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -1183,7 +1183,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, } /* Copy the plan's query string into the portal */ - query_string = MemoryContextStrdup(PortalGetHeapMemory(portal), + query_string = MemoryContextStrdup(portal->portalContext, plansource->query_string); /* @@ -1213,7 +1213,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, * will result in leaking our refcount on the plan, but it doesn't * matter because the plan is unsaved and hence transient anyway. */ - oldcontext = MemoryContextSwitchTo(PortalGetHeapMemory(portal)); + oldcontext = MemoryContextSwitchTo(portal->portalContext); stmt_list = copyObject(stmt_list); MemoryContextSwitchTo(oldcontext); ReleaseCachedPlan(cplan, false); @@ -1311,7 +1311,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, */ if (paramLI) { - oldcontext = MemoryContextSwitchTo(PortalGetHeapMemory(portal)); + oldcontext = MemoryContextSwitchTo(portal->portalContext); paramLI = copyParamList(paramLI); MemoryContextSwitchTo(oldcontext); } |