aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-12-16 17:43:41 -0500
committerPeter Eisentraut <peter_e@gmx.net>2018-01-09 13:47:56 -0500
commita77dd53f3089a3d6bf74966bfd3ab7e27537183b (patch)
tree8d841865fad219438a8712d9552f4cdf09459c4c /src
parent0f7c49e85518dd846ccd0a044d49a922b9132983 (diff)
downloadpostgresql-a77dd53f3089a3d6bf74966bfd3ab7e27537183b.tar.gz
postgresql-a77dd53f3089a3d6bf74966bfd3ab7e27537183b.zip
Remove PortalGetQueryDesc()
After having gotten rid of PortalGetHeapMemory(), there seems little reason to keep one Portal access macro around that offers no actual abstraction and isn't consistently used anyway. Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/portalcmds.c4
-rw-r--r--src/backend/executor/execCurrent.c2
-rw-r--r--src/backend/tcop/pquery.c4
-rw-r--r--src/include/utils/portal.h5
4 files changed, 5 insertions, 10 deletions
diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c
index e9771546893..6ecaea14433 100644
--- a/src/backend/commands/portalcmds.c
+++ b/src/backend/commands/portalcmds.c
@@ -277,7 +277,7 @@ PortalCleanup(Portal portal)
* since other mechanisms will take care of releasing executor resources,
* and we can't be sure that ExecutorEnd itself wouldn't fail.
*/
- queryDesc = PortalGetQueryDesc(portal);
+ queryDesc = portal->queryDesc;
if (queryDesc)
{
/*
@@ -317,7 +317,7 @@ PortalCleanup(Portal portal)
void
PersistHoldablePortal(Portal portal)
{
- QueryDesc *queryDesc = PortalGetQueryDesc(portal);
+ QueryDesc *queryDesc = portal->queryDesc;
Portal saveActivePortal;
ResourceOwner saveResourceOwner;
MemoryContext savePortalContext;
diff --git a/src/backend/executor/execCurrent.c b/src/backend/executor/execCurrent.c
index 6a8db582dba..ce7d4ac592a 100644
--- a/src/backend/executor/execCurrent.c
+++ b/src/backend/executor/execCurrent.c
@@ -75,7 +75,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
(errcode(ERRCODE_INVALID_CURSOR_STATE),
errmsg("cursor \"%s\" is not a SELECT query",
cursor_name)));
- queryDesc = PortalGetQueryDesc(portal);
+ queryDesc = portal->queryDesc;
if (queryDesc == NULL || queryDesc->estate == NULL)
ereport(ERROR,
(errcode(ERRCODE_INVALID_CURSOR_STATE),
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index 0420231864f..66cc5c35c68 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -885,7 +885,7 @@ PortalRunSelect(Portal portal,
* NB: queryDesc will be NULL if we are fetching from a held cursor or a
* completed utility query; can't use it in that path.
*/
- queryDesc = PortalGetQueryDesc(portal);
+ queryDesc = portal->queryDesc;
/* Caller messed up if we have neither a ready query nor held data. */
Assert(queryDesc || portal->holdStore);
@@ -1694,7 +1694,7 @@ DoPortalRewind(Portal portal)
}
/* Rewind executor, if active */
- queryDesc = PortalGetQueryDesc(portal);
+ queryDesc = portal->queryDesc;
if (queryDesc)
{
PushActiveSnapshot(queryDesc->snapshot);
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index 8cedc0ea602..bc9d52e506e 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -198,11 +198,6 @@ typedef struct PortalData
*/
#define PortalIsValid(p) PointerIsValid(p)
-/*
- * Access macros for Portal ... use these in preference to field access.
- */
-#define PortalGetQueryDesc(portal) ((portal)->queryDesc)
-
/* Prototypes for functions in utils/mmgr/portalmem.c */
extern void EnablePortalManager(void);