PostgreSQL Source Code
git master
|
Go to the source code of this file.
Typedefs | |
typedef struct ResourceOwnerData * | ResourceOwner |
typedef void(* | ResourceReleaseCallback) (ResourceReleasePhase phase, bool isCommit, bool isTopLevel, void *arg) |
Enumerations | |
enum | ResourceReleasePhase { RESOURCE_RELEASE_BEFORE_LOCKS , RESOURCE_RELEASE_LOCKS , RESOURCE_RELEASE_AFTER_LOCKS } |
Functions | |
ResourceOwner | ResourceOwnerCreate (ResourceOwner parent, const char *name) |
void | ResourceOwnerRelease (ResourceOwner owner, ResourceReleasePhase phase, bool isCommit, bool isTopLevel) |
void | ResourceOwnerReleaseAllPlanCacheRefs (ResourceOwner owner) |
void | ResourceOwnerDelete (ResourceOwner owner) |
ResourceOwner | ResourceOwnerGetParent (ResourceOwner owner) |
void | ResourceOwnerNewParent (ResourceOwner owner, ResourceOwner newparent) |
void | RegisterResourceReleaseCallback (ResourceReleaseCallback callback, void *arg) |
void | UnregisterResourceReleaseCallback (ResourceReleaseCallback callback, void *arg) |
void | CreateAuxProcessResourceOwner (void) |
void | ReleaseAuxProcessResources (bool isCommit) |
typedef struct ResourceOwnerData* ResourceOwner |
Definition at line 27 of file resowner.h.
typedef void(* ResourceReleaseCallback) (ResourceReleasePhase phase, bool isCommit, bool isTopLevel, void *arg) |
Definition at line 57 of file resowner.h.
enum ResourceReleasePhase |
Enumerator | |
---|---|
RESOURCE_RELEASE_BEFORE_LOCKS | |
RESOURCE_RELEASE_LOCKS | |
RESOURCE_RELEASE_AFTER_LOCKS |
Definition at line 46 of file resowner.h.
void CreateAuxProcessResourceOwner | ( | void | ) |
Definition at line 914 of file resowner.c.
References Assert(), AuxProcessResourceOwner, CurrentResourceOwner, on_shmem_exit(), ReleaseAuxProcessResourcesCallback(), and ResourceOwnerCreate().
Referenced by AuxiliaryProcessMain(), and InitPostgres().
void RegisterResourceReleaseCallback | ( | ResourceReleaseCallback | callback, |
void * | arg | ||
) |
Definition at line 876 of file resowner.c.
References ResourceReleaseCallbackItem::arg, arg, ResourceReleaseCallbackItem::callback, callback(), MemoryContextAlloc(), ResourceReleaseCallbackItem::next, ResourceRelease_callbacks, and TopMemoryContext.
Referenced by px_find_cipher(), and px_find_digest().
void ReleaseAuxProcessResources | ( | bool | isCommit | ) |
Definition at line 934 of file resowner.c.
References AuxProcessResourceOwner, RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, and ResourceOwnerRelease().
Referenced by AutoVacLauncherMain(), BackgroundWriterMain(), CheckpointerMain(), InitPostgres(), ReleaseAuxProcessResourcesCallback(), and WalWriterMain().
ResourceOwner ResourceOwnerCreate | ( | ResourceOwner | parent, |
const char * | name | ||
) |
Definition at line 429 of file resowner.c.
References ResourceOwnerData::bufferarr, BufferGetDatum, ResourceOwnerData::bufferioarr, ResourceOwnerData::catlistrefarr, ResourceOwnerData::catrefarr, ResourceOwnerData::cryptohasharr, ResourceOwnerData::dsmarr, ResourceOwnerData::filearr, FileGetDatum, ResourceOwnerData::firstchild, ResourceOwnerData::hmacarr, InvalidBuffer, ResourceOwnerData::jitarr, MemoryContextAllocZero(), name, ResourceOwnerData::name, ResourceOwnerData::nextchild, ResourceOwnerData::parent, ResourceOwnerData::planrefarr, PointerGetDatum(), ResourceOwnerData::relrefarr, ResourceArrayInit(), ResourceOwnerData::snapshotarr, TopMemoryContext, and ResourceOwnerData::tupdescarr.
Referenced by AtStart_ResourceOwner(), AtSubStart_ResourceOwner(), CreateAuxProcessResourceOwner(), CreatePortal(), perform_base_backup(), plpgsql_call_handler(), plpgsql_create_econtext(), and plpgsql_inline_handler().
void ResourceOwnerDelete | ( | ResourceOwner | owner | ) |
Definition at line 762 of file resowner.c.
References Assert(), ResourceOwnerData::bufferarr, ResourceOwnerData::bufferioarr, ResourceOwnerData::catlistrefarr, ResourceOwnerData::catrefarr, ResourceOwnerData::cryptohasharr, CurrentResourceOwner, ResourceOwnerData::dsmarr, ResourceOwnerData::filearr, ResourceOwnerData::firstchild, ResourceOwnerData::hmacarr, ResourceOwnerData::jitarr, MAX_RESOWNER_LOCKS, ResourceArray::nitems, ResourceOwnerData::nlocks, pfree(), ResourceOwnerData::planrefarr, ResourceOwnerData::relrefarr, ResourceArrayFree(), ResourceOwnerNewParent(), ResourceOwnerData::snapshotarr, and ResourceOwnerData::tupdescarr.
Referenced by CleanupSubTransaction(), CleanupTransaction(), CommitSubTransaction(), CommitTransaction(), plpgsql_call_handler(), plpgsql_inline_handler(), PortalDrop(), PrepareTransaction(), and WalSndResourceCleanup().
ResourceOwner ResourceOwnerGetParent | ( | ResourceOwner | owner | ) |
Definition at line 819 of file resowner.c.
References ResourceOwnerData::parent.
Referenced by LockReassignCurrentOwner().
void ResourceOwnerNewParent | ( | ResourceOwner | owner, |
ResourceOwner | newparent | ||
) |
Definition at line 828 of file resowner.c.
References Assert(), ResourceOwnerData::firstchild, ResourceOwnerData::nextchild, and ResourceOwnerData::parent.
Referenced by AtSubAbort_Portals(), AtSubCommit_Portals(), and ResourceOwnerDelete().
void ResourceOwnerRelease | ( | ResourceOwner | owner, |
ResourceReleasePhase | phase, | ||
bool | isCommit, | ||
bool | isTopLevel | ||
) |
Definition at line 488 of file resowner.c.
References ResourceOwnerReleaseInternal().
Referenced by AbortSubTransaction(), AbortTransaction(), CommitSubTransaction(), CommitTransaction(), PortalDrop(), PrepareTransaction(), ReleaseAuxProcessResources(), and WalSndResourceCleanup().
void ResourceOwnerReleaseAllPlanCacheRefs | ( | ResourceOwner | owner | ) |
Definition at line 743 of file resowner.c.
References DatumGetPointer(), ResourceOwnerData::planrefarr, ReleaseCachedPlan(), res, and ResourceArrayGetAny().
Referenced by plpgsql_call_handler(), plpgsql_inline_handler(), and plpgsql_xact_cb().
void UnregisterResourceReleaseCallback | ( | ResourceReleaseCallback | callback, |
void * | arg | ||
) |
Definition at line 890 of file resowner.c.
References ResourceReleaseCallbackItem::arg, arg, ResourceReleaseCallbackItem::callback, callback(), ResourceReleaseCallbackItem::next, pfree(), and ResourceRelease_callbacks.
|
extern |
Definition at line 150 of file resowner.c.
Referenced by AutoVacLauncherMain(), CreateAuxProcessResourceOwner(), ReleaseAuxProcessResources(), ShutdownXLOG(), and StartupXLOG().
|
extern |
Definition at line 147 of file resowner.c.
Referenced by _SPI_execute_plan(), apply_spooled_messages(), AssignTransactionId(), AtAbort_ResourceOwner(), AtStart_ResourceOwner(), AtSubAbort_ResourceOwner(), AtSubStart_ResourceOwner(), BgBufferSync(), BufferSync(), cipher_free_callback(), CleanupSubTransaction(), CleanupTransaction(), close_lo_relation(), CommitSubTransaction(), CommitTransaction(), CreateAuxProcessResourceOwner(), DecrTupleDescRefCount(), digest_free_callback(), dsm_create_descriptor(), dsm_unpin_mapping(), exec_eval_simple_expr(), exec_init_tuple_store(), exec_simple_check_plan(), exec_stmt_block(), ExplainExecuteQuery(), ExtendBufferedRelShared(), extendBufFile(), FlushDatabaseBuffers(), FlushRelationBuffers(), FlushRelationsAllBuffers(), GetCurrentFDWTuplestore(), GetLocalVictimBuffer(), GetVictimBuffer(), IncrBufferRefCount(), IncrTupleDescRefCount(), InitPostgres(), llvm_create_context(), lock_and_open_sequence(), LockAcquireExtended(), LockReassignCurrentOwner(), LockReassignOwner(), LockRelease(), makeBufFileCommon(), MakeTransitionCaptureState(), open_lo_relation(), OpenTemporaryFile(), PathNameCreateTemporaryFile(), PathNameOpenTemporaryFile(), perform_base_backup(), PersistHoldablePortal(), pg_cryptohash_create(), pg_hmac_create(), pg_logical_replication_slot_advance(), pg_logical_slot_get_changes_guts(), PinBuffer(), PinBuffer_Locked(), PinLocalBuffer(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plpgsql_estate_setup(), pltcl_func_handler(), pltcl_init_tuple_store(), pltcl_returnnext(), pltcl_SPI_execute(), pltcl_SPI_execute_plan(), pltcl_SPI_prepare(), pltcl_subtrans_abort(), pltcl_subtrans_commit(), pltcl_subtransaction(), PLy_abort_open_subtransactions(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_commit(), PLy_subtransaction_enter(), PLy_subtransaction_exit(), PopTransaction(), PortalCleanup(), PortalRun(), PortalRunFetch(), PortalStart(), PrepareTransaction(), px_find_cipher(), px_find_digest(), ReadBuffer_common(), ReadRecentBuffer(), RegisterSnapshot(), RegisterTemporaryFile(), RelationDecrementReferenceCount(), RelationIncrementReferenceCount(), ReleaseCatCache(), ReleaseCatCacheList(), ReleaseLockIfHeld(), ResourceOwnerDelete(), ResourceOwnerReleaseInternal(), SearchCatCacheInternal(), SearchCatCacheList(), SearchCatCacheMiss(), ShutdownXLOG(), SnapBuildClearExportedSnapshot(), SnapBuildExportSnapshot(), SPI_plan_get_cached_plan(), StartBufferIO(), StartupXLOG(), TerminateBufferIO(), tuplestore_begin_common(), tuplestore_puttuple_common(), UnpinBuffer(), UnpinLocalBuffer(), UnregisterSnapshot(), and WalSndResourceCleanup().
|
extern |
Definition at line 148 of file resowner.c.
Referenced by AtStart_ResourceOwner(), AtSubStart_ResourceOwner(), CleanupSubTransaction(), CleanupTransaction(), CommitSubTransaction(), CommitTransaction(), CreatePortal(), GetCurrentFDWTuplestore(), MakeTransitionCaptureState(), PopTransaction(), and PrepareTransaction().
|
extern |
Definition at line 149 of file resowner.c.
Referenced by AbortTransaction(), apply_spooled_messages(), AtAbort_ResourceOwner(), AtStart_ResourceOwner(), be_lo_open(), CleanupTransaction(), close_lo_relation(), closeLOfd(), CommitTransaction(), lock_and_open_sequence(), open_lo_relation(), plpgsql_create_econtext(), PortalRun(), PrepareTransaction(), and ResourceOwnerReleaseInternal().