PostgreSQL Source Code  git master
portalcmds.c File Reference
#include "postgres.h"
#include <limits.h>
#include "access/xact.h"
#include "commands/portalcmds.h"
#include "executor/executor.h"
#include "executor/tstoreReceiver.h"
#include "miscadmin.h"
#include "rewrite/rewriteHandler.h"
#include "tcop/pquery.h"
#include "tcop/tcopprot.h"
#include "utils/memutils.h"
#include "utils/snapmgr.h"
Include dependency graph for portalcmds.c:

Go to the source code of this file.

Functions

void PerformCursorOpen (ParseState *pstate, DeclareCursorStmt *cstmt, ParamListInfo params, bool isTopLevel)
 
void PerformPortalFetch (FetchStmt *stmt, DestReceiver *dest, QueryCompletion *qc)
 
void PerformPortalClose (const char *name)
 
void PortalCleanup (Portal portal)
 
void PersistHoldablePortal (Portal portal)
 

Function Documentation

◆ PerformCursorOpen()

void PerformCursorOpen ( ParseState pstate,
DeclareCursorStmt cstmt,
ParamListInfo  params,
bool  isTopLevel 
)

Definition at line 43 of file portalcmds.c.

References Assert, castNode, CMD_SELECT, Query::commandType, copyObject, copyParamList(), CreatePortal(), CURSOR_OPT_HOLD, CURSOR_OPT_NO_SCROLL, CURSOR_OPT_SCROLL, PortalData::cursorOptions, elog, ereport, errcode(), errmsg(), ERROR, ExecSupportsBackwardScan(), GetActiveSnapshot(), InSecurityRestrictedOperation(), linitial_node, list_length(), list_make1, MemoryContextSwitchTo(), NIL, DeclareCursorStmt::options, ParseState::p_sourcetext, pg_plan_query(), PlannedStmt::planTree, PORTAL_ONE_SELECT, PortalData::portalContext, PortalDefineQuery(), DeclareCursorStmt::portalname, PortalStart(), pstrdup(), DeclareCursorStmt::query, QueryRewrite(), RequireTransactionBlock(), PlannedStmt::rowMarks, and PortalData::strategy.

Referenced by standard_ProcessUtility().

45 {
46  Query *query = castNode(Query, cstmt->query);
47  List *rewritten;
48  PlannedStmt *plan;
49  Portal portal;
50  MemoryContext oldContext;
51  char *queryString;
52 
53  /*
54  * Disallow empty-string cursor name (conflicts with protocol-level
55  * unnamed portal).
56  */
57  if (!cstmt->portalname || cstmt->portalname[0] == '\0')
58  ereport(ERROR,
59  (errcode(ERRCODE_INVALID_CURSOR_NAME),
60  errmsg("invalid cursor name: must not be empty")));
61 
62  /*
63  * If this is a non-holdable cursor, we require that this statement has
64  * been executed inside a transaction block (or else, it would have no
65  * user-visible effect).
66  */
67  if (!(cstmt->options & CURSOR_OPT_HOLD))
68  RequireTransactionBlock(isTopLevel, "DECLARE CURSOR");
70  ereport(ERROR,
71  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
72  errmsg("cannot create a cursor WITH HOLD within security-restricted operation")));
73 
74  /*
75  * Parse analysis was done already, but we still have to run the rule
76  * rewriter. We do not do AcquireRewriteLocks: we assume the query either
77  * came straight from the parser, or suitable locks were acquired by
78  * plancache.c.
79  */
80  rewritten = QueryRewrite(query);
81 
82  /* SELECT should never rewrite to more or less than one query */
83  if (list_length(rewritten) != 1)
84  elog(ERROR, "non-SELECT statement in DECLARE CURSOR");
85 
86  query = linitial_node(Query, rewritten);
87 
88  if (query->commandType != CMD_SELECT)
89  elog(ERROR, "non-SELECT statement in DECLARE CURSOR");
90 
91  /* Plan the query, applying the specified options */
92  plan = pg_plan_query(query, pstate->p_sourcetext, cstmt->options, params);
93 
94  /*
95  * Create a portal and copy the plan and query string into its memory.
96  */
97  portal = CreatePortal(cstmt->portalname, false, false);
98 
99  oldContext = MemoryContextSwitchTo(portal->portalContext);
100 
101  plan = copyObject(plan);
102 
103  queryString = pstrdup(pstate->p_sourcetext);
104 
105  PortalDefineQuery(portal,
106  NULL,
107  queryString,
108  CMDTAG_SELECT, /* cursor's query is always a SELECT */
109  list_make1(plan),
110  NULL);
111 
112  /*----------
113  * Also copy the outer portal's parameter list into the inner portal's
114  * memory context. We want to pass down the parameter values in case we
115  * had a command like
116  * DECLARE c CURSOR FOR SELECT ... WHERE foo = $1
117  * This will have been parsed using the outer parameter set and the
118  * parameter value needs to be preserved for use when the cursor is
119  * executed.
120  *----------
121  */
122  params = copyParamList(params);
123 
124  MemoryContextSwitchTo(oldContext);
125 
126  /*
127  * Set up options for portal.
128  *
129  * If the user didn't specify a SCROLL type, allow or disallow scrolling
130  * based on whether it would require any additional runtime overhead to do
131  * so. Also, we disallow scrolling for FOR UPDATE cursors.
132  */
133  portal->cursorOptions = cstmt->options;
135  {
136  if (plan->rowMarks == NIL &&
138  portal->cursorOptions |= CURSOR_OPT_SCROLL;
139  else
141  }
142 
143  /*
144  * Start execution, inserting parameters if any.
145  */
146  PortalStart(portal, params, 0, GetActiveSnapshot());
147 
148  Assert(portal->strategy == PORTAL_ONE_SELECT);
149 
150  /*
151  * We're done; the query won't actually be run until PerformPortalFetch is
152  * called.
153  */
154 }
ParamListInfo copyParamList(ParamListInfo from)
Definition: params.c:78
#define NIL
Definition: pg_list.h:65
Portal CreatePortal(const char *name, bool allowDup, bool dupSilent)
Definition: portalmem.c:175
List * QueryRewrite(Query *parsetree)
void PortalStart(Portal portal, ParamListInfo params, int eflags, Snapshot snapshot)
Definition: pquery.c:430
#define castNode(_type_, nodeptr)
Definition: nodes.h:605
char * pstrdup(const char *in)
Definition: mcxt.c:1299
#define CURSOR_OPT_HOLD
Definition: parsenodes.h:2823
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
Snapshot GetActiveSnapshot(void)
Definition: snapmgr.c:801
int errcode(int sqlerrcode)
Definition: elog.c:698
void PortalDefineQuery(Portal portal, const char *prepStmtName, const char *sourceText, CommandTag commandTag, List *stmts, CachedPlan *cplan)
Definition: portalmem.c:282
#define linitial_node(type, l)
Definition: pg_list.h:177
MemoryContext portalContext
Definition: portal.h:120
#define CURSOR_OPT_NO_SCROLL
Definition: parsenodes.h:2820
struct Plan * planTree
Definition: plannodes.h:64
#define list_make1(x1)
Definition: pg_list.h:206
#define ERROR
Definition: elog.h:46
PortalStrategy strategy
Definition: portal.h:146
const char * p_sourcetext
Definition: parse_node.h:181
bool ExecSupportsBackwardScan(Plan *node)
Definition: execAmi.c:512
List * rowMarks
Definition: plannodes.h:78
#define ereport(elevel,...)
Definition: elog.h:157
CmdType commandType
Definition: parsenodes.h:120
#define Assert(condition)
Definition: c.h:804
bool InSecurityRestrictedOperation(void)
Definition: miscinit.c:627
static int list_length(const List *l)
Definition: pg_list.h:149
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define CURSOR_OPT_SCROLL
Definition: parsenodes.h:2819
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Definition: postgres.c:829
int cursorOptions
Definition: portal.h:147
#define copyObject(obj)
Definition: nodes.h:652
Definition: pg_list.h:50
void RequireTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3459

◆ PerformPortalClose()

void PerformPortalClose ( const char *  name)

Definition at line 214 of file portalcmds.c.

References ereport, errcode(), errmsg(), ERROR, GetPortalByName(), PortalDrop(), PortalHashTableDeleteAll(), and PortalIsValid.

Referenced by standard_ProcessUtility().

215 {
216  Portal portal;
217 
218  /* NULL means CLOSE ALL */
219  if (name == NULL)
220  {
222  return;
223  }
224 
225  /*
226  * Disallow empty-string cursor name (conflicts with protocol-level
227  * unnamed portal).
228  */
229  if (name[0] == '\0')
230  ereport(ERROR,
231  (errcode(ERRCODE_INVALID_CURSOR_NAME),
232  errmsg("invalid cursor name: must not be empty")));
233 
234  /*
235  * get the portal from the portal name
236  */
237  portal = GetPortalByName(name);
238  if (!PortalIsValid(portal))
239  {
240  ereport(ERROR,
241  (errcode(ERRCODE_UNDEFINED_CURSOR),
242  errmsg("cursor \"%s\" does not exist", name)));
243  return; /* keep compiler happy */
244  }
245 
246  /*
247  * Note: PortalCleanup is called as a side-effect, if not already done.
248  */
249  PortalDrop(portal, false);
250 }
Portal GetPortalByName(const char *name)
Definition: portalmem.c:130
int errcode(int sqlerrcode)
Definition: elog.c:698
#define ERROR
Definition: elog.h:46
#define PortalIsValid(p)
Definition: portal.h:212
#define ereport(elevel,...)
Definition: elog.h:157
void PortalHashTableDeleteAll(void)
Definition: portalmem.c:607
const char * name
Definition: encode.c:561
int errmsg(const char *fmt,...)
Definition: elog.c:909
void PortalDrop(Portal portal, bool isTopCommit)
Definition: portalmem.c:468

◆ PerformPortalFetch()

void PerformPortalFetch ( FetchStmt stmt,
DestReceiver dest,
QueryCompletion qc 
)

Definition at line 167 of file portalcmds.c.

References FetchStmt::direction, ereport, errcode(), errmsg(), ERROR, GetPortalByName(), FetchStmt::howMany, FetchStmt::ismove, None_Receiver, PortalIsValid, FetchStmt::portalname, PortalRunFetch(), and SetQueryCompletion().

Referenced by standard_ProcessUtility().

170 {
171  Portal portal;
172  uint64 nprocessed;
173 
174  /*
175  * Disallow empty-string cursor name (conflicts with protocol-level
176  * unnamed portal).
177  */
178  if (!stmt->portalname || stmt->portalname[0] == '\0')
179  ereport(ERROR,
180  (errcode(ERRCODE_INVALID_CURSOR_NAME),
181  errmsg("invalid cursor name: must not be empty")));
182 
183  /* get the portal from the portal name */
184  portal = GetPortalByName(stmt->portalname);
185  if (!PortalIsValid(portal))
186  {
187  ereport(ERROR,
188  (errcode(ERRCODE_UNDEFINED_CURSOR),
189  errmsg("cursor \"%s\" does not exist", stmt->portalname)));
190  return; /* keep compiler happy */
191  }
192 
193  /* Adjust dest if needed. MOVE wants destination DestNone */
194  if (stmt->ismove)
195  dest = None_Receiver;
196 
197  /* Do it */
198  nprocessed = PortalRunFetch(portal,
199  stmt->direction,
200  stmt->howMany,
201  dest);
202 
203  /* Return command status if wanted */
204  if (qc)
205  SetQueryCompletion(qc, stmt->ismove ? CMDTAG_MOVE : CMDTAG_FETCH,
206  nprocessed);
207 }
Portal GetPortalByName(const char *name)
Definition: portalmem.c:130
uint64 PortalRunFetch(Portal portal, FetchDirection fdirection, long count, DestReceiver *dest)
Definition: pquery.c:1388
int errcode(int sqlerrcode)
Definition: elog.c:698
DestReceiver * None_Receiver
Definition: dest.c:96
#define ERROR
Definition: elog.h:46
char * portalname
Definition: parsenodes.h:2870
#define PortalIsValid(p)
Definition: portal.h:212
bool ismove
Definition: parsenodes.h:2871
long howMany
Definition: parsenodes.h:2869
#define ereport(elevel,...)
Definition: elog.h:157
static void SetQueryCompletion(QueryCompletion *qc, CommandTag commandTag, uint64 nprocessed)
Definition: cmdtag.h:36
int errmsg(const char *fmt,...)
Definition: elog.c:909
FetchDirection direction
Definition: parsenodes.h:2868

◆ PersistHoldablePortal()

void PersistHoldablePortal ( Portal  portal)

Definition at line 316 of file portalcmds.c.

References ActivePortal, Assert, PortalData::atEnd, CreateDestReceiver(), PortalData::createSubid, CreateTupleDescCopy(), CurrentResourceOwner, CURSOR_OPT_SCROLL, PortalData::cursorOptions, QueryDesc::dest, DestTuplestore, elog, ERROR, ExecutorEnd(), ExecutorFinish(), ExecutorRewind(), ExecutorRun(), ForwardScanDirection, FreeQueryDesc(), PortalData::holdContext, PortalData::holdSnapshot, PortalData::holdStore, InvalidSubTransactionId, MarkPortalActive(), MarkPortalFailed(), MemoryContextDeleteChildren(), MemoryContextSwitchTo(), NoMovementScanDirection, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PopActiveSnapshot(), PORTAL_READY, PortalContext, PortalData::portalContext, PortalData::portalPos, PushActiveSnapshot(), PortalData::queryDesc, _DestReceiver::rDestroy, PortalData::resowner, SetTuplestoreDestReceiverParams(), QueryDesc::snapshot, PortalData::status, PortalData::tupDesc, tuplestore_rescan(), and tuplestore_skiptuples().

Referenced by HoldPortal().

317 {
318  QueryDesc *queryDesc = portal->queryDesc;
319  Portal saveActivePortal;
320  ResourceOwner saveResourceOwner;
321  MemoryContext savePortalContext;
322  MemoryContext oldcxt;
323 
324  /*
325  * If we're preserving a holdable portal, we had better be inside the
326  * transaction that originally created it.
327  */
329  Assert(queryDesc != NULL);
330 
331  /*
332  * Caller must have created the tuplestore already ... but not a snapshot.
333  */
334  Assert(portal->holdContext != NULL);
335  Assert(portal->holdStore != NULL);
336  Assert(portal->holdSnapshot == NULL);
337 
338  /*
339  * Before closing down the executor, we must copy the tupdesc into
340  * long-term memory, since it was created in executor memory.
341  */
342  oldcxt = MemoryContextSwitchTo(portal->holdContext);
343 
344  portal->tupDesc = CreateTupleDescCopy(portal->tupDesc);
345 
346  MemoryContextSwitchTo(oldcxt);
347 
348  /*
349  * Check for improper portal use, and mark portal active.
350  */
351  MarkPortalActive(portal);
352 
353  /*
354  * Set up global portal context pointers.
355  */
356  saveActivePortal = ActivePortal;
357  saveResourceOwner = CurrentResourceOwner;
358  savePortalContext = PortalContext;
359  PG_TRY();
360  {
362 
363  ActivePortal = portal;
364  if (portal->resowner)
365  CurrentResourceOwner = portal->resowner;
366  PortalContext = portal->portalContext;
367 
369 
370  PushActiveSnapshot(queryDesc->snapshot);
371 
372  /*
373  * If the portal is marked scrollable, we need to store the entire
374  * result set in the tuplestore, so that subsequent backward FETCHs
375  * can be processed. Otherwise, store only the not-yet-fetched rows.
376  * (The latter is not only more efficient, but avoids semantic
377  * problems if the query's output isn't stable.)
378  *
379  * In the no-scroll case, tuple indexes in the tuplestore will not
380  * match the cursor's nominal position (portalPos). Currently this
381  * causes no difficulty because we only navigate in the tuplestore by
382  * relative position, except for the tuplestore_skiptuples call below
383  * and the tuplestore_rescan call in DoPortalRewind, both of which are
384  * disabled for no-scroll cursors. But someday we might need to track
385  * the offset between the holdStore and the cursor's nominal position
386  * explicitly.
387  */
388  if (portal->cursorOptions & CURSOR_OPT_SCROLL)
389  {
390  ExecutorRewind(queryDesc);
391  }
392  else
393  {
394  /*
395  * If we already reached end-of-query, set the direction to
396  * NoMovement to avoid trying to fetch any tuples. (This check
397  * exists because not all plan node types are robust about being
398  * called again if they've already returned NULL once.) We'll
399  * still set up an empty tuplestore, though, to keep this from
400  * being a special case later.
401  */
402  if (portal->atEnd)
403  direction = NoMovementScanDirection;
404  }
405 
406  /*
407  * Change the destination to output to the tuplestore. Note we tell
408  * the tuplestore receiver to detoast all data passed through it; this
409  * makes it safe to not keep a snapshot associated with the data.
410  */
411  queryDesc->dest = CreateDestReceiver(DestTuplestore);
413  portal->holdStore,
414  portal->holdContext,
415  true,
416  NULL,
417  NULL);
418 
419  /* Fetch the result set into the tuplestore */
420  ExecutorRun(queryDesc, direction, 0L, false);
421 
422  queryDesc->dest->rDestroy(queryDesc->dest);
423  queryDesc->dest = NULL;
424 
425  /*
426  * Now shut down the inner executor.
427  */
428  portal->queryDesc = NULL; /* prevent double shutdown */
429  ExecutorFinish(queryDesc);
430  ExecutorEnd(queryDesc);
431  FreeQueryDesc(queryDesc);
432 
433  /*
434  * Set the position in the result set.
435  */
437 
438  if (portal->atEnd)
439  {
440  /*
441  * Just force the tuplestore forward to its end. The size of the
442  * skip request here is arbitrary.
443  */
444  while (tuplestore_skiptuples(portal->holdStore, 1000000, true))
445  /* continue */ ;
446  }
447  else
448  {
449  tuplestore_rescan(portal->holdStore);
450 
451  /*
452  * In the no-scroll case, the start of the tuplestore is exactly
453  * where we want to be, so no repositioning is wanted.
454  */
455  if (portal->cursorOptions & CURSOR_OPT_SCROLL)
456  {
457  if (!tuplestore_skiptuples(portal->holdStore,
458  portal->portalPos,
459  true))
460  elog(ERROR, "unexpected end of tuple stream");
461  }
462  }
463  }
464  PG_CATCH();
465  {
466  /* Uncaught error while executing portal: mark it dead */
467  MarkPortalFailed(portal);
468 
469  /* Restore global vars and propagate error */
470  ActivePortal = saveActivePortal;
471  CurrentResourceOwner = saveResourceOwner;
472  PortalContext = savePortalContext;
473 
474  PG_RE_THROW();
475  }
476  PG_END_TRY();
477 
478  MemoryContextSwitchTo(oldcxt);
479 
480  /* Mark portal not active */
481  portal->status = PORTAL_READY;
482 
483  ActivePortal = saveActivePortal;
484  CurrentResourceOwner = saveResourceOwner;
485  PortalContext = savePortalContext;
486 
488 
489  /*
490  * We can now release any subsidiary memory of the portal's context; we'll
491  * never use it again. The executor already dropped its context, but this
492  * will clean up anything that glommed onto the portal's context via
493  * PortalContext.
494  */
496 }
void tuplestore_rescan(Tuplestorestate *state)
Definition: tuplestore.c:1233
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
Definition: tupdesc.c:111
bool atEnd
Definition: portal.h:200
void FreeQueryDesc(QueryDesc *qdesc)
Definition: pquery.c:105
Portal ActivePortal
Definition: pquery.c:35
ResourceOwner CurrentResourceOwner
Definition: resowner.c:146
void SetTuplestoreDestReceiverParams(DestReceiver *self, Tuplestorestate *tStore, MemoryContext tContext, bool detoast, TupleDesc target_tupdesc, const char *map_failure_msg)
void MarkPortalActive(Portal portal)
Definition: portalmem.c:395
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
MemoryContext holdContext
Definition: portal.h:178
void PopActiveSnapshot(void)
Definition: snapmgr.c:774
MemoryContext portalContext
Definition: portal.h:120
Snapshot snapshot
Definition: execdesc.h:39
MemoryContext PortalContext
Definition: mcxt.c:57
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:459
#define ERROR
Definition: elog.h:46
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
Definition: execMain.c:298
void PushActiveSnapshot(Snapshot snap)
Definition: snapmgr.c:680
DestReceiver * CreateDestReceiver(CommandDest dest)
Definition: dest.c:113
ScanDirection
Definition: sdir.h:22
SubTransactionId createSubid
Definition: portal.h:131
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:399
QueryDesc * queryDesc
Definition: portal.h:157
void MemoryContextDeleteChildren(MemoryContext context)
Definition: mcxt.c:263
void ExecutorRewind(QueryDesc *queryDesc)
Definition: execMain.c:525
TupleDesc tupDesc
Definition: portal.h:160
void(* rDestroy)(DestReceiver *self)
Definition: dest.h:127
#define PG_CATCH()
Definition: elog.h:323
#define Assert(condition)
Definition: c.h:804
Snapshot holdSnapshot
Definition: portal.h:188
void MarkPortalFailed(Portal portal)
Definition: portalmem.c:442
PortalStatus status
Definition: portal.h:151
#define PG_RE_THROW()
Definition: elog.h:354
bool tuplestore_skiptuples(Tuplestorestate *state, int64 ntuples, bool forward)
Definition: tuplestore.c:1135
#define InvalidSubTransactionId
Definition: c.h:593
DestReceiver * dest
Definition: execdesc.h:41
ResourceOwner resowner
Definition: portal.h:121
Tuplestorestate * holdStore
Definition: portal.h:177
#define elog(elevel,...)
Definition: elog.h:232
#define CURSOR_OPT_SCROLL
Definition: parsenodes.h:2819
int cursorOptions
Definition: portal.h:147
#define PG_TRY()
Definition: elog.h:313
#define PG_END_TRY()
Definition: elog.h:338
uint64 portalPos
Definition: portal.h:201

◆ PortalCleanup()

void PortalCleanup ( Portal  portal)

Definition at line 263 of file portalcmds.c.

References AssertArg, PortalData::cleanup, CurrentResourceOwner, ExecutorEnd(), ExecutorFinish(), FreeQueryDesc(), PORTAL_FAILED, PortalCleanup(), PortalIsValid, PortalData::queryDesc, PortalData::resowner, and PortalData::status.

Referenced by CreatePortal(), and PortalCleanup().

264 {
265  QueryDesc *queryDesc;
266 
267  /*
268  * sanity checks
269  */
270  AssertArg(PortalIsValid(portal));
271  AssertArg(portal->cleanup == PortalCleanup);
272 
273  /*
274  * Shut down executor, if still running. We skip this during error abort,
275  * since other mechanisms will take care of releasing executor resources,
276  * and we can't be sure that ExecutorEnd itself wouldn't fail.
277  */
278  queryDesc = portal->queryDesc;
279  if (queryDesc)
280  {
281  /*
282  * Reset the queryDesc before anything else. This prevents us from
283  * trying to shut down the executor twice, in case of an error below.
284  * The transaction abort mechanisms will take care of resource cleanup
285  * in such a case.
286  */
287  portal->queryDesc = NULL;
288 
289  if (portal->status != PORTAL_FAILED)
290  {
291  ResourceOwner saveResourceOwner;
292 
293  /* We must make the portal's resource owner current */
294  saveResourceOwner = CurrentResourceOwner;
295  if (portal->resowner)
296  CurrentResourceOwner = portal->resowner;
297 
298  ExecutorFinish(queryDesc);
299  ExecutorEnd(queryDesc);
300  FreeQueryDesc(queryDesc);
301 
302  CurrentResourceOwner = saveResourceOwner;
303  }
304  }
305 }
void(* cleanup)(Portal portal)
Definition: portal.h:122
void FreeQueryDesc(QueryDesc *qdesc)
Definition: pquery.c:105
ResourceOwner CurrentResourceOwner
Definition: resowner.c:146
void PortalCleanup(Portal portal)
Definition: portalcmds.c:263
void ExecutorEnd(QueryDesc *queryDesc)
Definition: execMain.c:459
#define AssertArg(condition)
Definition: c.h:806
void ExecutorFinish(QueryDesc *queryDesc)
Definition: execMain.c:399
QueryDesc * queryDesc
Definition: portal.h:157
#define PortalIsValid(p)
Definition: portal.h:212
PortalStatus status
Definition: portal.h:151
ResourceOwner resowner
Definition: portal.h:121