#include "postgres.h"
#include "access/xact.h"
#include "commands/portalcmds.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/ipc.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/snapmgr.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Definition at line 46 of file portalmem.c.
Definition at line 81 of file portalmem.c.
Definition at line 68 of file portalmem.c.
Definition at line 56 of file portalmem.c.
Definition at line 38 of file portalmem.c.
Definition at line 781 of file portalmem.c.
References PortalData::autoHeld, PortalData::cleanup, PortalData::createSubid, hash_seq_init(), hash_seq_search(), InvalidSubTransactionId, MarkPortalFailed(), MemoryContextDeleteChildren(), portalhashent::portal, PORTAL_ACTIVE, PORTAL_READY, PortalData::portalContext, PortalHashTable, PortalReleaseCachedPlan(), PortalData::resowner, shmem_exit_inprogress, and PortalData::status.
Referenced by AbortOutOfAnyTransaction(), and AbortTransaction().
Definition at line 858 of file portalmem.c.
References Assert(), PortalData::autoHeld, PortalData::cleanup, PortalData::createSubid, elog, hash_seq_init(), hash_seq_search(), InvalidSubTransactionId, PortalData::name, portalhashent::portal, PORTAL_ACTIVE, PortalDrop(), PortalHashTable, PortalData::portalPinned, PortalData::resowner, PortalData::status, and WARNING.
Referenced by CleanupTransaction().
Definition at line 979 of file portalmem.c.
References PortalData::activeSubid, PortalData::cleanup, PortalData::createSubid, hash_seq_init(), hash_seq_search(), MarkPortalFailed(), MemoryContextDeleteChildren(), portalhashent::portal, PORTAL_ACTIVE, PORTAL_FAILED, PORTAL_READY, PortalData::portalContext, PortalHashTable, PortalReleaseCachedPlan(), ResourceOwnerNewParent(), PortalData::resowner, and PortalData::status.
Referenced by AbortOutOfAnyTransaction(), and AbortSubTransaction().
Definition at line 1092 of file portalmem.c.
References PortalData::cleanup, PortalData::createSubid, elog, hash_seq_init(), hash_seq_search(), PortalData::name, portalhashent::portal, PortalDrop(), PortalHashTable, PortalData::portalPinned, and WARNING.
Referenced by CleanupSubTransaction().
Definition at line 943 of file portalmem.c.
References PortalData::activeSubid, PortalData::createLevel, PortalData::createSubid, hash_seq_init(), hash_seq_search(), portalhashent::portal, PortalHashTable, ResourceOwnerNewParent(), and PortalData::resowner.
Referenced by CommitSubTransaction().
Definition at line 235 of file portalmem.c.
References CreatePortal(), GetPortalByName(), MAX_PORTALNAME_LEN, and sprintf.
Referenced by ExecuteQuery(), and SPI_cursor_open_internal().
Definition at line 175 of file portalmem.c.
References PortalData::activeSubid, ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert(), PortalData::atEnd, PortalData::atStart, PortalData::cleanup, PortalData::createLevel, PortalData::createSubid, PortalData::creation_time, CURSOR_OPT_NO_SCROLL, PortalData::cursorOptions, CurTransactionResourceOwner, ereport, errcode(), errmsg(), ERROR, GetCurrentStatementStartTimestamp(), GetCurrentSubTransactionId(), GetCurrentTransactionNestLevel(), GetPortalByName(), MemoryContextAllocZero(), MemoryContextSetIdentifier(), name, PortalData::name, PORTAL_MULTI_QUERY, PORTAL_NEW, PortalCleanup(), PortalData::portalContext, PortalDrop(), PortalHashTableInsert, PortalIsValid, ResourceOwnerCreate(), PortalData::resowner, PortalData::status, PortalData::strategy, TopPortalContext, PortalData::visible, and WARNING.
Referenced by CreateNewPortal(), exec_bind_message(), exec_simple_query(), PerformCursorOpen(), and SPI_cursor_open_internal().
Definition at line 104 of file portalmem.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert(), ctl, hash_create(), HASH_ELEM, HASH_STRINGS, MAX_PORTALNAME_LEN, PortalHashTable, PORTALS_PER_USER, TopMemoryContext, and TopPortalContext.
Referenced by InitPostgres().
Definition at line 1256 of file portalmem.c.
References ActiveSnapshotSet(), elog, ERROR, hash_seq_init(), hash_seq_search(), PopActiveSnapshot(), portalhashent::portal, PortalHashTable, and PortalData::portalSnapshot.
Referenced by _SPI_commit(), and _SPI_rollback().
Definition at line 130 of file portalmem.c.
References name, and PortalHashTableLookup.
Referenced by CreateNewPortal(), CreatePortal(), exec_describe_portal_message(), exec_execute_message(), exec_simple_query(), execCurrentOf(), FetchStatementTargetList(), PerformPortalClose(), PerformPortalFetch(), PLy_cursor_close(), PLy_cursor_dealloc(), PLy_cursor_fetch(), PLy_cursor_iternext(), PostgresMain(), SPI_cursor_find(), UtilityReturnsTuples(), and UtilityTupleDescriptor().
Definition at line 1207 of file portalmem.c.
References PortalData::autoHeld, elog, ereport, errcode(), errmsg(), ERROR, hash_seq_init(), hash_seq_search(), HoldPortal(), portalhashent::portal, PORTAL_ONE_SELECT, PORTAL_READY, PortalHashTable, PortalData::portalPinned, PortalData::status, and PortalData::strategy.
Referenced by _SPI_commit(), and _SPI_rollback().
Definition at line 636 of file portalmem.c.
References PortalData::activeSubid, PortalData::createLevel, PortalData::createSubid, InvalidSubTransactionId, PersistHoldablePortal(), PortalCreateHoldStore(), PortalReleaseCachedPlan(), and PortalData::resowner.
Referenced by HoldPinnedPortals(), and PreCommit_Portals().
Definition at line 395 of file portalmem.c.
References PortalData::activeSubid, ereport, errcode(), errmsg(), ERROR, GetCurrentSubTransactionId(), PortalData::name, PORTAL_ACTIVE, PORTAL_READY, and PortalData::status.
Referenced by PersistHoldablePortal(), PortalRun(), and PortalRunFetch().
Definition at line 414 of file portalmem.c.
References Assert(), PortalData::cleanup, PORTAL_ACTIVE, PORTAL_DONE, and PortalData::status.
Referenced by PortalRun().
Definition at line 442 of file portalmem.c.
References Assert(), PortalData::cleanup, PORTAL_DONE, PORTAL_FAILED, and PortalData::status.
Referenced by AtAbort_Portals(), AtSubAbort_Portals(), PersistHoldablePortal(), PortalRun(), PortalRunFetch(), and PortalStart().
Definition at line 1131 of file portalmem.c.
References BoolGetDatum(), PortalData::creation_time, CStringGetTextDatum, CURSOR_OPT_BINARY, CURSOR_OPT_HOLD, CURSOR_OPT_SCROLL, PortalData::cursorOptions, hash_seq_init(), hash_seq_search(), InitMaterializedSRF(), PortalData::name, PortalHashTable, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, PortalData::sourceText, TimestampTzGetDatum(), tuplestore_putvalues(), values, and PortalData::visible.
Definition at line 371 of file portalmem.c.
References elog, ERROR, and PortalData::portalPinned.
Referenced by exec_for_query(), plperl_spi_query(), plperl_spi_query_prepared(), PLy_cursor_plan(), and PLy_cursor_query().
Definition at line 331 of file portalmem.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert(), CURSOR_OPT_SCROLL, PortalData::cursorOptions, PortalData::holdContext, PortalData::holdSnapshot, PortalData::holdStore, MemoryContextSwitchTo(), TopPortalContext, tuplestore_begin_heap(), and work_mem.
Referenced by FillPortalStore(), and HoldPortal().
Definition at line 282 of file portalmem.c.
References Assert(), QueryCompletion::commandTag, PortalData::commandTag, PortalData::cplan, NIL, QueryCompletion::nprocessed, PORTAL_DEFINED, PORTAL_NEW, PortalIsValid, PortalData::prepStmtName, PortalData::qc, PortalData::sourceText, PortalData::status, and PortalData::stmts.
Referenced by exec_bind_message(), exec_simple_query(), ExecuteQuery(), PerformCursorOpen(), and SPI_cursor_open_internal().
Definition at line 468 of file portalmem.c.
References Assert(), PortalData::cleanup, ereport, errcode(), errmsg(), ERROR, PortalData::holdContext, PortalData::holdSnapshot, PortalData::holdStore, MemoryContextDelete(), MemoryContextSwitchTo(), PortalData::name, pfree(), PORTAL_ACTIVE, PORTAL_FAILED, PortalData::portalContext, PortalHashTableDelete, PortalIsValid, PortalData::portalPinned, PortalReleaseCachedPlan(), PortalData::portalSnapshot, RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, ResourceOwnerDelete(), ResourceOwnerRelease(), PortalData::resowner, PortalData::status, tuplestore_end(), and UnregisterSnapshotFromOwner().
Referenced by AtCleanup_Portals(), AtSubCleanup_Portals(), CreatePortal(), exec_simple_query(), ExecuteQuery(), PerformPortalClose(), PortalErrorCleanup(), PortalHashTableDeleteAll(), PostgresMain(), PreCommit_Portals(), and SPI_cursor_close().
Definition at line 917 of file portalmem.c.
References PortalData::autoHeld, hash_seq_init(), hash_seq_search(), portalhashent::portal, PortalDrop(), PortalHashTable, and PortalData::portalPinned.
Referenced by PostgresMain().
Definition at line 151 of file portalmem.c.
References lfirst_node, stmt, and PortalData::stmts.
Referenced by FetchPortalTargetList(), and PortalStart().
Definition at line 607 of file portalmem.c.
References hash_seq_init(), hash_seq_search(), hash_seq_term(), portalhashent::portal, PORTAL_ACTIVE, PortalDrop(), PortalHashTable, and PortalData::status.
Referenced by DiscardAll(), and PerformPortalClose().
Definition at line 310 of file portalmem.c.
References PortalData::cplan, NIL, ReleaseCachedPlan(), and PortalData::stmts.
Referenced by AtAbort_Portals(), AtSubAbort_Portals(), HoldPortal(), and PortalDrop().
Definition at line 677 of file portalmem.c.
References PortalData::autoHeld, PortalData::createSubid, CURSOR_OPT_HOLD, PortalData::cursorOptions, elog, ereport, errcode(), errmsg(), ERROR, hash_seq_init(), hash_seq_search(), hash_seq_term(), HoldPortal(), PortalData::holdSnapshot, InvalidSubTransactionId, portalhashent::portal, PORTAL_ACTIVE, PORTAL_READY, PortalDrop(), PortalHashTable, PortalData::portalPinned, PortalData::portalSnapshot, PortalData::resowner, PortalData::status, and UnregisterSnapshotFromOwner().
Referenced by CommitTransaction(), and PrepareTransaction().
Definition at line 1171 of file portalmem.c.
References hash_seq_init(), hash_seq_search(), portalhashent::portal, PORTAL_READY, PortalHashTable, and PortalData::status.
Referenced by CopyFrom().
Definition at line 380 of file portalmem.c.
References elog, ERROR, and PortalData::portalPinned.
Referenced by exec_for_query(), plperl_spi_cursor_close(), plperl_spi_fetchrow(), PLy_cursor_close(), and PLy_cursor_dealloc().
Definition at line 54 of file portalmem.c.
Referenced by AtAbort_Portals(), AtCleanup_Portals(), AtSubAbort_Portals(), AtSubCleanup_Portals(), AtSubCommit_Portals(), EnablePortalManager(), ForgetPortalSnapshots(), HoldPinnedPortals(), pg_cursor(), PortalErrorCleanup(), PortalHashTableDeleteAll(), PreCommit_Portals(), and ThereAreNoReadyPortals().
Definition at line 91 of file portalmem.c.
Referenced by CreatePortal(), EnablePortalManager(), and PortalCreateHoldStore().