PostgreSQL Source Code git master
|
#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 "nodes/queryjumble.h"
#include "parser/analyze.h"
#include "rewrite/rewriteHandler.h"
#include "tcop/pquery.h"
#include "tcop/tcopprot.h"
#include "utils/memutils.h"
#include "utils/snapmgr.h"
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) |
void PerformCursorOpen | ( | ParseState * | pstate, |
DeclareCursorStmt * | cstmt, | ||
ParamListInfo | params, | ||
bool | isTopLevel | ||
) |
Definition at line 45 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(), IsQueryIdEnabled(), JumbleQuery(), linitial_node, list_length(), list_make1, MemoryContextSwitchTo(), NIL, DeclareCursorStmt::options, ParseState::p_sourcetext, pg_plan_query(), plan, PORTAL_ONE_SELECT, PortalData::portalContext, PortalDefineQuery(), DeclareCursorStmt::portalname, PortalStart(), post_parse_analyze_hook, pstrdup(), DeclareCursorStmt::query, QueryRewrite(), RequireTransactionBlock(), and PortalData::strategy.
Referenced by standard_ProcessUtility().
void PerformPortalClose | ( | const char * | name | ) |
Definition at line 224 of file portalcmds.c.
References ereport, errcode(), errmsg(), ERROR, GetPortalByName(), name, PortalDrop(), PortalHashTableDeleteAll(), and PortalIsValid.
Referenced by standard_ProcessUtility().
void PerformPortalFetch | ( | FetchStmt * | stmt, |
DestReceiver * | dest, | ||
QueryCompletion * | qc | ||
) |
Definition at line 177 of file portalcmds.c.
References generate_unaccent_rules::dest, ereport, errcode(), errmsg(), ERROR, GetPortalByName(), None_Receiver, PortalIsValid, PortalRunFetch(), SetQueryCompletion(), and stmt.
Referenced by standard_ProcessUtility().
void PersistHoldablePortal | ( | Portal | portal | ) |
Definition at line 326 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().
void PortalCleanup | ( | Portal | portal | ) |
Definition at line 273 of file portalcmds.c.
References Assert, PortalData::cleanup, CurrentResourceOwner, ExecutorEnd(), ExecutorFinish(), FreeQueryDesc(), PORTAL_FAILED, PortalCleanup(), PortalIsValid, PortalData::queryDesc, PortalData::resowner, and PortalData::status.
Referenced by CreatePortal(), and PortalCleanup().