PostgreSQL Source Code git master
|
Go to the source code of this file.
Functions | |
PortalStrategy | ChoosePortalStrategy (List *stmts) |
List * | FetchPortalTargetList (Portal portal) |
List * | FetchStatementTargetList (Node *stmt) |
void | PortalStart (Portal portal, ParamListInfo params, int eflags, Snapshot snapshot) |
void | PortalSetResultFormat (Portal portal, int nFormats, int16 *formats) |
bool | PortalRun (Portal portal, long count, bool isTopLevel, DestReceiver *dest, DestReceiver *altdest, QueryCompletion *qc) |
uint64 | PortalRunFetch (Portal portal, FetchDirection fdirection, long count, DestReceiver *dest) |
bool | PlannedStmtRequiresSnapshot (struct PlannedStmt *pstmt) |
void | EnsurePortalSnapshotExists (void) |
Variables | |
PGDLLIMPORT Portal | ActivePortal |
PortalStrategy ChoosePortalStrategy | ( | List * | stmts | ) |
Definition at line 209 of file pquery.c.
References PlannedStmt::canSetTag, CMD_SELECT, CMD_UTILITY, Query::commandType, PlannedStmt::commandType, elog, ERROR, PlannedStmt::hasModifyingCTE, PlannedStmt::hasReturning, IsA, lfirst, linitial, list_length(), NIL, nodeTag, PORTAL_MULTI_QUERY, PORTAL_ONE_MOD_WITH, PORTAL_ONE_RETURNING, PORTAL_ONE_SELECT, PORTAL_UTIL_SELECT, Query::returningList, stmt, UtilityReturnsTuples(), Query::utilityStmt, and PlannedStmt::utilityStmt.
Referenced by PlanCacheComputeResultDesc(), and PortalStart().
void EnsurePortalSnapshotExists | ( | void | ) |
Definition at line 1771 of file pquery.c.
References ActivePortal, ActiveSnapshotSet(), Assert, PortalData::createLevel, elog, ERROR, GetActiveSnapshot(), GetTransactionSnapshot(), PortalData::portalSnapshot, PushActiveSnapshotWithLevel(), and unlikely.
Referenced by _SPI_execute_plan(), exec_eval_simple_expr(), and ExecuteCallStmt().
Definition at line 326 of file pquery.c.
References FetchStatementTargetList(), NIL, PORTAL_MULTI_QUERY, PortalGetPrimaryStmt(), and PortalData::strategy.
Referenced by exec_describe_portal_message(), FetchStatementTargetList(), and printtup_startup().
Definition at line 348 of file pquery.c.
References Assert, CMD_SELECT, CMD_UTILITY, Query::commandType, PlannedStmt::commandType, FetchPortalTargetList(), FetchPreparedStatement(), FetchPreparedStatementTargetList(), GetPortalByName(), PlannedStmt::hasReturning, IsA, FetchStmt::ismove, ExecuteStmt::name, NIL, PlannedStmt::planTree, PortalIsValid, FetchStmt::portalname, Query::returningList, stmt, Query::targetList, Plan::targetlist, Query::utilityStmt, and PlannedStmt::utilityStmt.
Referenced by CachedPlanGetTargetList(), and FetchPortalTargetList().
bool PlannedStmtRequiresSnapshot | ( | struct PlannedStmt * | pstmt | ) |
Definition at line 1723 of file pquery.c.
References IsA, and PlannedStmt::utilityStmt.
Referenced by _SPI_execute_plan(), and PortalRunUtility().
bool PortalRun | ( | Portal | portal, |
long | count, | ||
bool | isTopLevel, | ||
DestReceiver * | dest, | ||
DestReceiver * | altdest, | ||
QueryCompletion * | qc | ||
) |
Definition at line 684 of file pquery.c.
References ActivePortal, Assert, PortalData::atEnd, QueryCompletion::commandTag, CopyQueryCompletion(), CurrentMemoryContext, CurrentResourceOwner, DEBUG3, generate_unaccent_rules::dest, elog, ERROR, FillPortalStore(), PortalData::holdStore, InitializeQueryCompletion(), log_executor_stats, MarkPortalActive(), MarkPortalDone(), MarkPortalFailed(), MemoryContextSwitchTo(), QueryCompletion::nprocessed, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PORTAL_MULTI_QUERY, PORTAL_ONE_MOD_WITH, PORTAL_ONE_RETURNING, PORTAL_ONE_SELECT, PORTAL_READY, PORTAL_UTIL_SELECT, PortalContext, PortalData::portalContext, PortalIsValid, PortalRunMulti(), PortalRunSelect(), PortalData::qc, ResetUsage(), PortalData::resowner, ShowUsage(), PortalData::status, PortalData::strategy, TopTransactionContext, and TopTransactionResourceOwner.
Referenced by exec_execute_message(), exec_simple_query(), and ExecuteQuery().
uint64 PortalRunFetch | ( | Portal | portal, |
FetchDirection | fdirection, | ||
long | count, | ||
DestReceiver * | dest | ||
) |
Definition at line 1385 of file pquery.c.
References ActivePortal, Assert, CurrentResourceOwner, generate_unaccent_rules::dest, DoPortalRunFetch(), elog, ERROR, FillPortalStore(), PortalData::holdStore, MarkPortalActive(), MarkPortalFailed(), MemoryContextSwitchTo(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PORTAL_ONE_MOD_WITH, PORTAL_ONE_RETURNING, PORTAL_ONE_SELECT, PORTAL_READY, PORTAL_UTIL_SELECT, PortalContext, PortalData::portalContext, PortalIsValid, PortalData::resowner, PortalData::status, and PortalData::strategy.
Referenced by _SPI_cursor_operation(), and PerformPortalFetch().
Definition at line 623 of file pquery.c.
References ereport, errcode(), errmsg(), ERROR, PortalData::formats, i, MemoryContextAlloc(), TupleDescData::natts, PortalData::portalContext, and PortalData::tupDesc.
Referenced by exec_bind_message(), and exec_simple_query().
void PortalStart | ( | Portal | portal, |
ParamListInfo | params, | ||
int | eflags, | ||
Snapshot | snapshot | ||
) |
Definition at line 433 of file pquery.c.
References ActivePortal, Assert, PortalData::atEnd, PortalData::atStart, ChoosePortalStrategy(), CMD_UTILITY, PlannedStmt::commandType, CreateQueryDesc(), CurrentResourceOwner, CURSOR_OPT_SCROLL, PortalData::cursorOptions, EXEC_FLAG_BACKWARD, EXEC_FLAG_REWIND, ExecCleanTypeFromTL(), ExecutorStart(), GetActiveSnapshot(), GetTransactionSnapshot(), InvalidSnapshot, linitial_node, MarkPortalFailed(), MemoryContextSwitchTo(), None_Receiver, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PlannedStmt::planTree, PopActiveSnapshot(), PORTAL_DEFINED, PORTAL_MULTI_QUERY, PORTAL_ONE_MOD_WITH, PORTAL_ONE_RETURNING, PORTAL_ONE_SELECT, PORTAL_READY, PORTAL_UTIL_SELECT, PortalContext, PortalData::portalContext, PortalGetPrimaryStmt(), PortalIsValid, PortalData::portalParams, PortalData::portalPos, PushActiveSnapshot(), PortalData::queryDesc, PortalData::queryEnv, PortalData::resowner, PortalData::sourceText, PortalData::status, PortalData::stmts, PortalData::strategy, Plan::targetlist, QueryDesc::tupDesc, PortalData::tupDesc, PlannedStmt::utilityStmt, and UtilityTupleDescriptor().
Referenced by exec_bind_message(), exec_simple_query(), ExecuteQuery(), PerformCursorOpen(), and SPI_cursor_open_internal().
|
extern |
Definition at line 35 of file pquery.c.
Referenced by EnsurePortalSnapshotExists(), function_parse_error_transpose(), PersistHoldablePortal(), PortalRun(), PortalRunFetch(), and PortalStart().