Skip to content

Commit a77dd53

Browse files
committed
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>
1 parent 0f7c49e commit a77dd53

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

src/backend/commands/portalcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ PortalCleanup(Portal portal)
277277
* since other mechanisms will take care of releasing executor resources,
278278
* and we can't be sure that ExecutorEnd itself wouldn't fail.
279279
*/
280-
queryDesc = PortalGetQueryDesc(portal);
280+
queryDesc = portal->queryDesc;
281281
if (queryDesc)
282282
{
283283
/*
@@ -317,7 +317,7 @@ PortalCleanup(Portal portal)
317317
void
318318
PersistHoldablePortal(Portal portal)
319319
{
320-
QueryDesc *queryDesc = PortalGetQueryDesc(portal);
320+
QueryDesc *queryDesc = portal->queryDesc;
321321
Portal saveActivePortal;
322322
ResourceOwner saveResourceOwner;
323323
MemoryContext savePortalContext;

src/backend/executor/execCurrent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
7575
(errcode(ERRCODE_INVALID_CURSOR_STATE),
7676
errmsg("cursor \"%s\" is not a SELECT query",
7777
cursor_name)));
78-
queryDesc = PortalGetQueryDesc(portal);
78+
queryDesc = portal->queryDesc;
7979
if (queryDesc == NULL || queryDesc->estate == NULL)
8080
ereport(ERROR,
8181
(errcode(ERRCODE_INVALID_CURSOR_STATE),

src/backend/tcop/pquery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ PortalRunSelect(Portal portal,
885885
* NB: queryDesc will be NULL if we are fetching from a held cursor or a
886886
* completed utility query; can't use it in that path.
887887
*/
888-
queryDesc = PortalGetQueryDesc(portal);
888+
queryDesc = portal->queryDesc;
889889

890890
/* Caller messed up if we have neither a ready query nor held data. */
891891
Assert(queryDesc || portal->holdStore);
@@ -1694,7 +1694,7 @@ DoPortalRewind(Portal portal)
16941694
}
16951695

16961696
/* Rewind executor, if active */
1697-
queryDesc = PortalGetQueryDesc(portal);
1697+
queryDesc = portal->queryDesc;
16981698
if (queryDesc)
16991699
{
17001700
PushActiveSnapshot(queryDesc->snapshot);

src/include/utils/portal.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ typedef struct PortalData
198198
*/
199199
#define PortalIsValid(p) PointerIsValid(p)
200200

201-
/*
202-
* Access macros for Portal ... use these in preference to field access.
203-
*/
204-
#define PortalGetQueryDesc(portal) ((portal)->queryDesc)
205-
206201

207202
/* Prototypes for functions in utils/mmgr/portalmem.c */
208203
extern void EnablePortalManager(void);

0 commit comments

Comments
 (0)