PostgreSQL Source Code
git master
|
#include "access/transam.h"
#include "access/xlogreader.h"
#include "datatype/timestamp.h"
#include "lib/stringinfo.h"
#include "nodes/pg_list.h"
#include "storage/relfilelocator.h"
#include "storage/sinval.h"
Go to the source code of this file.
Data Structures | |
struct | SavedTransactionCharacteristics |
struct | xl_xact_assignment |
struct | xl_xact_xinfo |
struct | xl_xact_dbinfo |
struct | xl_xact_subxacts |
struct | xl_xact_relfilelocators |
struct | xl_xact_stats_item |
struct | xl_xact_stats_items |
struct | xl_xact_invals |
struct | xl_xact_twophase |
struct | xl_xact_origin |
struct | xl_xact_commit |
struct | xl_xact_abort |
struct | xl_xact_prepare |
struct | xl_xact_parsed_commit |
struct | xl_xact_parsed_abort |
#define IsolationIsSerializable | ( | ) | (XactIsoLevel == XACT_SERIALIZABLE) |
#define IsolationUsesXactSnapshot | ( | ) | (XactIsoLevel >= XACT_REPEATABLE_READ) |
#define MinSizeOfXactAbort sizeof(xl_xact_abort) |
#define MinSizeOfXactAssignment offsetof(xl_xact_assignment, xsub) |
#define MinSizeOfXactCommit (offsetof(xl_xact_commit, xact_time) + sizeof(TimestampTz)) |
#define MinSizeOfXactInvals offsetof(xl_xact_invals, msgs) |
#define MinSizeOfXactRelfileLocators offsetof(xl_xact_relfilelocators, xlocators) |
#define MinSizeOfXactStatsItems offsetof(xl_xact_stats_items, items) |
#define MinSizeOfXactSubxacts offsetof(xl_xact_subxacts, subxacts) |
#define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH |
#define XactCompletionApplyFeedback | ( | xinfo | ) | ((xinfo & XACT_COMPLETION_APPLY_FEEDBACK) != 0) |
#define XactCompletionForceSyncCommit | ( | xinfo | ) | ((xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT) != 0) |
#define XactCompletionRelcacheInitFileInval | ( | xinfo | ) | ((xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE) != 0) |
typedef struct SavedTransactionCharacteristics SavedTransactionCharacteristics |
typedef void(* SubXactCallback) (SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg) |
typedef struct xl_xact_abort xl_xact_abort |
typedef struct xl_xact_assignment xl_xact_assignment |
typedef struct xl_xact_commit xl_xact_commit |
typedef struct xl_xact_dbinfo xl_xact_dbinfo |
typedef struct xl_xact_invals xl_xact_invals |
typedef struct xl_xact_origin xl_xact_origin |
typedef struct xl_xact_parsed_abort xl_xact_parsed_abort |
typedef struct xl_xact_parsed_commit xl_xact_parsed_commit |
typedef struct xl_xact_prepare xl_xact_prepare |
typedef struct xl_xact_relfilelocators xl_xact_relfilelocators |
typedef struct xl_xact_stats_item xl_xact_stats_item |
typedef struct xl_xact_stats_items xl_xact_stats_items |
typedef struct xl_xact_subxacts xl_xact_subxacts |
typedef struct xl_xact_twophase xl_xact_twophase |
typedef struct xl_xact_xinfo xl_xact_xinfo |
enum SubXactEvent |
enum SyncCommitLevel |
enum XactEvent |
void AbortCurrentTransaction | ( | void | ) |
Definition at line 3351 of file xact.c.
References AbortCurrentTransactionInternal(), AbortSubTransaction(), TransactionStateData::blockState, CleanupSubTransaction(), CurrentTransactionState, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBRELEASE, and TBLOCK_SUBRESTART.
Referenced by _SPI_commit(), _SPI_rollback(), pa_stream_abort(), PostgresMain(), ReorderBufferImmediateInvalidation(), ReorderBufferProcessTXN(), and SnapBuildClearExportedSnapshot().
void AbortOutOfAnyTransaction | ( | void | ) |
Definition at line 4788 of file xact.c.
References AbortSubTransaction(), AbortTransaction(), Assert(), AtAbort_Memory(), AtAbort_Portals(), AtCleanup_Memory(), AtSubAbort_Portals(), TransactionStateData::blockState, CleanupSubTransaction(), CleanupTransaction(), CurrentTransactionState, TransactionStateData::curTransactionOwner, TransactionStateData::parent, TransactionStateData::state, TransactionStateData::subTransactionId, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, TBLOCK_SUBRESTART, TRANS_DEFAULT, TRANS_INPROGRESS, and TRANS_START.
Referenced by DisableSubscriptionAndExit(), do_autovacuum(), perform_work_item(), RemoveTempRelationsCallback(), ShutdownPostgres(), start_apply(), and start_table_sync().
void BeginImplicitTransactionBlock | ( | void | ) |
Definition at line 4248 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, TBLOCK_IMPLICIT_INPROGRESS, and TBLOCK_STARTED.
Referenced by exec_simple_query().
void BeginInternalSubTransaction | ( | const char * | name | ) |
Definition at line 4616 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CommitTransactionCommand(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), MemoryContextStrdup(), TransactionStateData::name, name, PushTransaction(), StartTransactionCommand(), TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, TBLOCK_SUBRESTART, and TopTransactionContext.
Referenced by exec_stmt_block(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), pltcl_returnnext(), pltcl_subtrans_begin(), pltcl_subtransaction(), PLy_spi_subtransaction_begin(), PLy_subtransaction_enter(), ReorderBufferImmediateInvalidation(), and ReorderBufferProcessTXN().
void BeginTransactionBlock | ( | void | ) |
Definition at line 3846 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), FATAL, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, TBLOCK_SUBRESTART, and WARNING.
Referenced by apply_handle_prepare_internal(), pa_start_subtrans(), and standard_ProcessUtility().
void CommandCounterIncrement | ( | void | ) |
Definition at line 1079 of file xact.c.
References AtCCI_LocalCache(), currentCommandId, currentCommandIdUsed, elog, ereport, errcode(), errmsg(), ERROR, InvalidCommandId, IsInParallelMode(), IsParallelWorker, and SnapshotSetCommandId().
Referenced by _SPI_execute_plan(), acquire_inherited_sample_rows(), addFkRecurseReferenced(), addFkRecurseReferencing(), AddRoleMems(), AlterPublicationOptions(), AlterRole(), ATAddCheckNNConstraint(), ATExecAddColumn(), ATExecAlterColumnType(), ATExecCmd(), ATExecDropColumn(), ATExecDropExpression(), ATExecDropIdentity(), ATExecSetCompression(), ATExecSetExpression(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), ATInheritAdjustNotNulls(), ATParseTransformCmd(), ATRewriteTables(), AttachPartitionEnsureIndexes(), btadjustmembers(), CloneFkReferencing(), CommitSubTransaction(), CommitTransactionCommandInternal(), copy_table_data(), create_ctas_internal(), create_toast_table(), CreateFKCheckTrigger(), createForeignKeyActionTriggers(), CreateForeignTable(), CreatePublication(), CreateRole(), CreateSchemaCommand(), CreateTriggerFiringOn(), DefineCollation(), DefineDomain(), DefineIndex(), DefineRelation(), DefineVirtualRelation(), deleteOneObject(), DetachPartitionFinalize(), DropClonedTriggersFromPartition(), dropconstraint_internal(), DropRole(), end_replication_step(), EventTriggerDDLCommandEnd(), EventTriggerDDLCommandStart(), EventTriggerInvoke(), EventTriggerSQLDrop(), EventTriggerTableRewrite(), exec_eval_simple_expr(), exec_execute_message(), exec_parse_message(), exec_simple_query(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), execute_sql_string(), ExplainOnePlan(), finish_heap_swap(), fmgr_sql(), hashadjustmembers(), ImportForeignSchema(), index_build(), index_create(), IndexSetParentIndex(), InitTempTableNamespace(), inv_create(), inv_drop(), inv_truncate(), inv_write(), LogicalRepSyncTableStart(), make_new_heap(), makeConfigurationDependencies(), moveArrayTypeName(), objectNamesToOids(), OperatorShellMake(), OperatorUpd(), pg_import_system_collations(), PortalRunMulti(), ProcedureCreate(), process_syncing_tables_for_apply(), ProcessUtilitySlow(), recordExtensionInitPrivWorker(), reindex_index(), reindex_relation(), ReindexRelationConcurrently(), RelationSetNewRelfilenumber(), RemoveRoleFromObjectPolicy(), RenumberEnumType(), replorigin_create(), replorigin_drop_by_name(), ri_PerformCheck(), SetDatatabaseHasLoginEventTriggers(), SetDefaultACL(), SetMatViewPopulatedState(), shdepReassignOwned(), SPI_cursor_open_internal(), standard_ProcessUtility(), StoreConstraints(), StorePartitionBound(), tryAttachPartitionForeignKey(), vacuum(), and validatePartitionedIndex().
void CommitTransactionCommand | ( | void | ) |
Definition at line 3053 of file xact.c.
References AbortSubTransaction(), TransactionStateData::blockState, CleanupSubTransaction(), CommitTransactionCommandInternal(), CurrentTransactionState, TBLOCK_SUBABORT_END, and TBLOCK_SUBABORT_PENDING.
Referenced by _SPI_commit(), AllTablesyncsReady(), apply_handle_commit_internal(), apply_handle_commit_prepared(), apply_handle_prepare(), apply_handle_prepare_internal(), apply_handle_rollback_prepared(), apply_handle_stream_prepare(), ATExecDetachPartition(), autoprewarm_database_main(), bbsink_server_new(), BeginInternalSubTransaction(), BootstrapModeMain(), clear_subscription_skip_lsn(), cluster_multiple_rels(), DefineIndex(), DisableSubscriptionAndExit(), do_autovacuum(), EventTriggerOnLogin(), exec_replication_command(), finish_xact_command(), get_database_list(), get_subscription_list(), IdentifySystem(), index_drop(), initialize_worker_spi(), InitializeLogRepWorker(), InitPostgres(), LogicalRepSyncTableStart(), maybe_reread_subscription(), movedb(), pa_start_subtrans(), pa_stream_abort(), ParallelApplyWorkerMain(), ParallelWorkerMain(), pg_attribute_noreturn(), process_syncing_tables_for_apply(), process_syncing_tables_for_sync(), ProcessCatchupInterrupt(), ProcessIncomingNotify(), ReindexMultipleInternal(), ReindexRelationConcurrently(), RemoveTempRelationsCallback(), run_apply_worker(), shell_check_detail(), stream_abort_internal(), stream_stop_internal(), synchronize_slots(), vacuum(), vacuum_rel(), validate_remote_info(), and worker_spi_main().
void DefineSavepoint | ( | const char * | name | ) |
Definition at line 4295 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), MemoryContextStrdup(), TransactionStateData::name, name, PushTransaction(), TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, TBLOCK_SUBRESTART, and TopTransactionContext.
Referenced by CommitTransactionCommandInternal(), pa_start_subtrans(), and standard_ProcessUtility().
void EndImplicitTransactionBlock | ( | void | ) |
Definition at line 4273 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, TBLOCK_IMPLICIT_INPROGRESS, and TBLOCK_STARTED.
Referenced by exec_simple_query().
void EndParallelWorkerTransaction | ( | void | ) |
Definition at line 5558 of file xact.c.
References Assert(), TransactionStateData::blockState, CommitTransaction(), CurrentTransactionState, TBLOCK_DEFAULT, and TBLOCK_PARALLEL_INPROGRESS.
Referenced by ParallelWorkerMain().
Definition at line 3966 of file xact.c.
References Assert(), TransactionStateData::blockState, BlockStateAsString(), TransactionStateData::chain, CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, TransactionStateData::parent, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, TBLOCK_SUBRESTART, and WARNING.
Referenced by apply_handle_commit_internal(), pa_stream_abort(), PrepareTransactionBlock(), and standard_ProcessUtility().
void EnterParallelMode | ( | void | ) |
Definition at line 1037 of file xact.c.
References Assert(), CurrentTransactionState, and TransactionStateData::parallelModeLevel.
Referenced by _brin_begin_parallel(), _bt_begin_parallel(), CommitTransaction(), ExecutePlan(), parallel_vacuum_init(), and ParallelWorkerMain().
Size EstimateTransactionStateSpace | ( | void | ) |
Definition at line 5434 of file xact.c.
References add_size(), CurrentTransactionState, TransactionStateData::fullTransactionId, FullTransactionIdIsValid, mul_size(), TransactionStateData::nChildXids, TransactionStateData::parent, SerializedTransactionStateHeaderSize, and size.
Referenced by InitializeParallelDSM().
void ExitParallelMode | ( | void | ) |
Definition at line 1050 of file xact.c.
References Assert(), CurrentTransactionState, ParallelContextActive(), and TransactionStateData::parallelModeLevel.
Referenced by _brin_begin_parallel(), _brin_end_parallel(), _bt_begin_parallel(), _bt_end_parallel(), ExecutePlan(), parallel_vacuum_end(), and ParallelWorkerMain().
void ForceSyncCommit | ( | void | ) |
Definition at line 1129 of file xact.c.
References forceSyncCommit.
Referenced by createdb(), CreateTableSpace(), dropdb(), DropTableSpace(), and movedb().
Definition at line 819 of file xact.c.
References Assert(), currentCommandId, currentCommandIdUsed, and IsParallelWorker.
Referenced by ATRewriteTable(), CatalogTuplesMultiInsertWithInfo(), CopyFrom(), create_edata_for_relation(), create_estate_for_relation(), GetSnapshotData(), GetSnapshotDataReuse(), intorel_startup(), pgrowlocks(), RegisterRelcacheInvalidation(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), simple_heap_delete(), simple_heap_insert(), simple_heap_update(), simple_table_tuple_delete(), simple_table_tuple_insert(), simple_table_tuple_update(), standard_ExecutorStart(), toast_save_datum(), transientrel_startup(), and UpdateActiveSnapshotCommandId().
FullTransactionId GetCurrentFullTransactionId | ( | void | ) |
Definition at line 504 of file xact.c.
References AssignTransactionId(), CurrentTransactionState, TransactionStateData::fullTransactionId, and FullTransactionIdIsValid.
FullTransactionId GetCurrentFullTransactionIdIfAny | ( | void | ) |
Definition at line 522 of file xact.c.
References CurrentTransactionState, and TransactionStateData::fullTransactionId.
TimestampTz GetCurrentStatementStartTimestamp | ( | void | ) |
Definition at line 865 of file xact.c.
References stmtStartTimestamp.
Referenced by check_log_duration(), CreatePortal(), InitializeParallelDSM(), pgstat_report_activity(), statement_timestamp(), and StorePreparedStatement().
SubTransactionId GetCurrentSubTransactionId | ( | void | ) |
Definition at line 781 of file xact.c.
References CurrentTransactionState, and TransactionStateData::subTransactionId.
Referenced by _SPI_begin_call(), AllocateDir(), AllocateFile(), be_lo_open(), CopyFrom(), CreateParallelContext(), CreatePortal(), ExecuteTruncateGuts(), init_sql_fcache(), InitTempTableNamespace(), MarkPortalActive(), OpenPipeStream(), OpenTransientFilePerm(), plpgsql_create_econtext(), plpgsql_inline_handler(), register_on_commit_action(), RelationAssumeNewRelfilelocator(), RelationBuildLocalRelation(), RelationForgetRelation(), remove_on_commit_action(), sepgsql_set_client_label(), SPI_connect_ext(), and spi_dest_startup().
TransactionId GetCurrentTransactionId | ( | void | ) |
Definition at line 446 of file xact.c.
References AssignTransactionId(), CurrentTransactionState, TransactionStateData::fullTransactionId, FullTransactionIdIsValid, and XidFromFullTransactionId.
Referenced by asyncQueueNotificationToEntry(), check_exclusion_or_unique_constraint(), ExecInsert(), heap_abort_speculative(), heap_delete(), heap_insert(), heap_lock_tuple(), heap_multi_insert(), heap_update(), LogAccessExclusiveLock(), LogAccessExclusiveLockPrepare(), logical_rewrite_log_mapping(), LogLogicalMessage(), PreCommit_Notify(), PrepareTransaction(), RelationSetNewRelfilenumber(), and ReorderBufferProcessTXN().
TransactionId GetCurrentTransactionIdIfAny | ( | void | ) |
Definition at line 463 of file xact.c.
References CurrentTransactionState, TransactionStateData::fullTransactionId, and XidFromFullTransactionId.
Referenced by IsSubxactTopXidLogPending(), RecordTransactionAbort(), ReorderBufferProcessTXN(), and XLogRecordAssemble().
int GetCurrentTransactionNestLevel | ( | void | ) |
Definition at line 915 of file xact.c.
References CurrentTransactionState, and TransactionStateData::nestingLevel.
Referenced by AfterTriggerBeginSubXact(), AfterTriggerEndSubXact(), AfterTriggerSetState(), Async_Notify(), AtEOSubXact_Inval(), AtSubAbort_Notify(), AtSubCommit_Notify(), AtSubCommit_smgr(), begin_remote_xact(), create_drop_transactional_internal(), CreatePortal(), ensure_tabstat_xact_level(), pgfdw_subxact_callback(), pgstat_drop_relation(), PrepareInvalidationState(), PushActiveSnapshot(), queue_listen(), register_seq_scan(), RelationCreateStorage(), RelationDropStorage(), RelationMapUpdateMap(), RestoreReindexState(), SetReindexPending(), SetReindexProcessing(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), and smgrGetPendingDeletes().
TimestampTz GetCurrentTransactionStartTimestamp | ( | void | ) |
Definition at line 856 of file xact.c.
References xactStartTimestamp.
Referenced by GetCurrentTimeUsec(), GetSQLCurrentTimestamp(), GetSQLLocalTimestamp(), InitializeParallelDSM(), now(), pg_timezone_abbrevs(), and timetz_zone().
TimestampTz GetCurrentTransactionStopTimestamp | ( | void | ) |
Definition at line 877 of file xact.c.
References Assert(), CurrentTransactionState, GetCurrentTimestamp(), PG_USED_FOR_ASSERTS_ONLY, TRANS_ABORT, TRANS_COMMIT, TRANS_DEFAULT, TRANS_PREPARE, and xactStopTimestamp.
Referenced by pgstat_relation_flush_cb(), pgstat_report_stat(), RecordTransactionAbort(), and RecordTransactionCommit().
TransactionId GetStableLatestTransactionId | ( | void | ) |
Definition at line 599 of file xact.c.
References Assert(), GetTopTransactionIdIfAny(), InvalidLocalTransactionId, InvalidTransactionId, PGPROC::lxid, MyProc, ReadNextTransactionId(), TransactionIdIsValid, and PGPROC::vxid.
Referenced by xid_age().
FullTransactionId GetTopFullTransactionId | ( | void | ) |
Definition at line 475 of file xact.c.
References AssignTransactionId(), FullTransactionIdIsValid, TopTransactionStateData, and XactTopFullTransactionId.
Referenced by pg_current_xact_id().
FullTransactionId GetTopFullTransactionIdIfAny | ( | void | ) |
Definition at line 491 of file xact.c.
References XactTopFullTransactionId.
Referenced by pg_current_xact_id_if_assigned().
TransactionId GetTopTransactionId | ( | void | ) |
Definition at line 418 of file xact.c.
References AssignTransactionId(), FullTransactionIdIsValid, TopTransactionStateData, XactTopFullTransactionId, and XidFromFullTransactionId.
Referenced by AlterSequence(), AssignTransactionId(), consume_xids_common(), do_setval(), fill_seq_fork_with_data(), log_heap_new_cid(), nextval_internal(), and SequenceChangePersistence().
TransactionId GetTopTransactionIdIfAny | ( | void | ) |
Definition at line 433 of file xact.c.
References XactTopFullTransactionId, and XidFromFullTransactionId.
Referenced by CheckForSerializableConflictOut(), ConditionalXactLockTableWait(), CreateInitDecodingContext(), ExportSnapshot(), GetSerializableTransactionSnapshotInt(), GetStableLatestTransactionId(), HeapCheckForSerializableConflictOut(), ImportSnapshot(), index_drop(), initSpGistState(), log_status_format(), RecordTransactionCommit(), TransactionIdIsCurrentTransactionId(), write_csvlog(), write_jsonlog(), XactLockTableWait(), XidIsConcurrent(), and XLogRecordAssemble().
bool IsAbortedTransactionBlockState | ( | void | ) |
Definition at line 399 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, TBLOCK_ABORT, and TBLOCK_SUBABORT.
Referenced by BuildParamLogString(), exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_execute_message(), exec_parse_message(), exec_replication_command(), exec_simple_query(), HandleFunctionRequest(), PostgresMain(), and ProcessRecoveryConflictInterrupt().
bool IsInParallelMode | ( | void | ) |
Definition at line 1070 of file xact.c.
References CurrentTransactionState, and TransactionStateData::parallelModeLevel.
Referenced by AbortSubTransaction(), AbortTransaction(), AssignTransactionId(), BeginInternalSubTransaction(), CheckTargetForConflictsIn(), CommandCounterIncrement(), CommitSubTransaction(), CommitTransaction(), CreateParallelContext(), CreatePredicateLock(), DefineSavepoint(), DeleteChildTargetLocks(), ExecSetVariableStmt(), GetLatestSnapshot(), GetNewTransactionId(), GetSerializableTransactionSnapshotInt(), GetTransactionSnapshot(), heap_delete(), heap_inplace_update(), heap_update(), heap_vacuum_rel(), PrepareTransaction(), PreventCommandIfParallelMode(), RelationCreateStorage(), RelationMapUpdateMap(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleasePredicateLocks(), ReleaseSavepoint(), RemoveReindexPending(), RollbackToSavepoint(), set_config_with_handle(), SetReindexPending(), standard_ExecutorStart(), standard_ProcessUtility(), and UpdateActiveSnapshotCommandId().
Definition at line 3688 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, IsSubTransaction(), IsTransactionBlock(), MyXactFlags, TBLOCK_DEFAULT, TBLOCK_STARTED, and XACT_FLAGS_PIPELINING.
Referenced by vacuum().
bool IsSubTransaction | ( | void | ) |
Definition at line 4965 of file xact.c.
References CurrentTransactionState, and TransactionStateData::nestingLevel.
Referenced by _SPI_commit(), _SPI_rollback(), AfterTriggerSetState(), check_transaction_deferrable(), check_transaction_isolation(), check_transaction_read_only(), CheckTargetForConflictsIn(), CheckTransactionBlock(), CreateReplicationSlot(), ExportSnapshot(), ImportSnapshot(), IsInTransactionBlock(), IsSubxactTopXidLogPending(), PreventInTransactionBlock(), and ProcessRecoveryConflictInterrupt().
bool IsSubxactTopXidLogPending | ( | void | ) |
Definition at line 551 of file xact.c.
References CurrentTransactionState, GetCurrentTransactionIdIfAny(), IsSubTransaction(), IsTransactionState(), TransactionStateData::topXidLogged, TransactionIdIsValid, and XLogLogicalInfoActive.
Referenced by MarkSubxactTopXidLogged(), and XLogRecordAssemble().
bool IsTransactionBlock | ( | void | ) |
Definition at line 4892 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, TBLOCK_DEFAULT, and TBLOCK_STARTED.
Referenced by apply_handle_commit_internal(), apply_handle_prepare_internal(), CheckTransactionBlock(), CreateReplicationSlot(), IsInTransactionBlock(), pa_start_subtrans(), pa_stream_abort(), PreventInTransactionBlock(), and standard_ProcessUtility().
bool IsTransactionOrTransactionBlock | ( | void | ) |
Definition at line 4910 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, and TBLOCK_DEFAULT.
Referenced by apply_handle_stream_stop(), pgstat_report_stat(), PostgresMain(), ProcessCatchupInterrupt(), ProcessInterrupts(), ProcessNotifyInterrupt(), ProcessRecoveryConflictInterrupt(), ReorderBufferImmediateInvalidation(), ReorderBufferProcessTXN(), SnapBuildExportSnapshot(), StartupDecodingContext(), and WalSndErrorCleanup().
bool IsTransactionState | ( | void | ) |
Definition at line 379 of file xact.c.
References CurrentTransactionState, TransactionStateData::state, and TRANS_INPROGRESS.
Referenced by apply_handle_commit_internal(), apply_handle_origin(), assign_transaction_timeout(), begin_replication_step(), check_client_encoding(), check_default_table_access_method(), check_default_tablespace(), check_default_text_search_config(), check_role(), check_session_authorization(), check_temp_tablespaces(), check_transaction_isolation(), check_transaction_read_only(), clear_subscription_skip_lsn(), CreateInitDecodingContext(), ensure_last_message(), FetchTableStates(), InitializeClientEncoding(), IsSubxactTopXidLogPending(), LogicalRepApplyLoop(), LogLogicalMessage(), maybe_reread_subscription(), pa_send_data(), pa_start_subtrans(), pg_attribute_noreturn(), pg_do_encoding_conversion(), PrepareClientEncoding(), PrepareTempTablespaces(), process_syncing_tables_for_apply(), process_syncing_tables_for_sync(), RelationClearRelation(), RelationIdGetRelation(), RelationInitPhysicalAddr(), RelationReloadNailed(), replorigin_create(), replorigin_drop_by_name(), SearchCatCacheInternal(), SetMultiXactIdLimit(), SetTransactionIdLimit(), SnapBuildClearExportedSnapshot(), SocketBackend(), stream_stop_internal(), synchronize_slots(), and validate_remote_info().
void MarkCurrentTransactionIdLoggedIfAny | ( | void | ) |
Definition at line 533 of file xact.c.
References CurrentTransactionState, TransactionStateData::didLogXid, TransactionStateData::fullTransactionId, and FullTransactionIdIsValid.
Referenced by XLogInsertRecord().
void MarkSubxactTopXidLogged | ( | void | ) |
Definition at line 583 of file xact.c.
References Assert(), CurrentTransactionState, IsSubxactTopXidLogPending(), and TransactionStateData::topXidLogged.
Referenced by XLogInsertRecord().
void ParseAbortRecord | ( | uint8 | info, |
xl_xact_abort * | xlrec, | ||
xl_xact_parsed_abort * | parsed | ||
) |
Definition at line 141 of file xactdesc.c.
References data, xl_xact_dbinfo::dbId, xl_xact_parsed_abort::dbId, xl_xact_stats_items::items, MinSizeOfXactAbort, MinSizeOfXactRelfileLocators, MinSizeOfXactStatsItems, MinSizeOfXactSubxacts, xl_xact_stats_items::nitems, xl_xact_relfilelocators::nrels, xl_xact_parsed_abort::nrels, xl_xact_parsed_abort::nstats, xl_xact_subxacts::nsubxacts, xl_xact_parsed_abort::nsubxacts, xl_xact_origin::origin_lsn, xl_xact_parsed_abort::origin_lsn, xl_xact_origin::origin_timestamp, xl_xact_parsed_abort::origin_timestamp, xl_xact_parsed_abort::stats, strlcpy(), xl_xact_subxacts::subxacts, xl_xact_parsed_abort::subxacts, xl_xact_dbinfo::tsId, xl_xact_parsed_abort::tsId, xl_xact_parsed_abort::twophase_gid, xl_xact_parsed_abort::twophase_xid, xl_xact_abort::xact_time, xl_xact_parsed_abort::xact_time, XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_DROPPED_STATS, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILELOCATORS, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, xl_xact_parsed_abort::xinfo, xl_xact_relfilelocators::xlocators, xl_xact_parsed_abort::xlocators, and XLOG_XACT_HAS_INFO.
Referenced by recoveryStopsAfter(), recoveryStopsBefore(), SummarizeXactRecord(), xact_decode(), xact_desc_abort(), and xact_redo().
void ParseCommitRecord | ( | uint8 | info, |
xl_xact_commit * | xlrec, | ||
xl_xact_parsed_commit * | parsed | ||
) |
Definition at line 35 of file xactdesc.c.
References data, xl_xact_dbinfo::dbId, xl_xact_parsed_commit::dbId, xl_xact_stats_items::items, MinSizeOfXactCommit, MinSizeOfXactInvals, MinSizeOfXactRelfileLocators, MinSizeOfXactStatsItems, MinSizeOfXactSubxacts, xl_xact_invals::msgs, xl_xact_parsed_commit::msgs, xl_xact_stats_items::nitems, xl_xact_invals::nmsgs, xl_xact_parsed_commit::nmsgs, xl_xact_relfilelocators::nrels, xl_xact_parsed_commit::nrels, xl_xact_parsed_commit::nstats, xl_xact_subxacts::nsubxacts, xl_xact_parsed_commit::nsubxacts, xl_xact_origin::origin_lsn, xl_xact_parsed_commit::origin_lsn, xl_xact_origin::origin_timestamp, xl_xact_parsed_commit::origin_timestamp, xl_xact_parsed_commit::stats, strlcpy(), xl_xact_subxacts::subxacts, xl_xact_parsed_commit::subxacts, xl_xact_dbinfo::tsId, xl_xact_parsed_commit::tsId, xl_xact_parsed_commit::twophase_gid, xl_xact_parsed_commit::twophase_xid, xl_xact_commit::xact_time, xl_xact_parsed_commit::xact_time, XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_DROPPED_STATS, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_INVALS, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILELOCATORS, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, xl_xact_parsed_commit::xinfo, xl_xact_relfilelocators::xlocators, xl_xact_parsed_commit::xlocators, and XLOG_XACT_HAS_INFO.
Referenced by recoveryStopsAfter(), recoveryStopsBefore(), SummarizeXactRecord(), xact_decode(), xact_desc_commit(), and xact_redo().
void ParsePrepareRecord | ( | uint8 | info, |
xl_xact_prepare * | xlrec, | ||
xl_xact_parsed_prepare * | parsed | ||
) |
Definition at line 239 of file xactdesc.c.
References xl_xact_parsed_commit::abortlocators, xl_xact_parsed_commit::abortstats, xl_xact_prepare::database, xl_xact_parsed_commit::dbId, xl_xact_prepare::gidlen, MAXALIGN, xl_xact_parsed_commit::msgs, xl_xact_prepare::nabortrels, xl_xact_parsed_commit::nabortrels, xl_xact_prepare::nabortstats, xl_xact_prepare::ncommitrels, xl_xact_prepare::ncommitstats, xl_xact_prepare::ninvalmsgs, xl_xact_parsed_commit::nmsgs, xl_xact_parsed_commit::nrels, xl_xact_prepare::nsubxacts, xl_xact_parsed_commit::nsubxacts, xl_xact_prepare::origin_lsn, xl_xact_parsed_commit::origin_lsn, xl_xact_prepare::origin_timestamp, xl_xact_parsed_commit::origin_timestamp, xl_xact_prepare::prepared_at, xl_xact_parsed_commit::stats, xl_xact_parsed_commit::subxacts, xl_xact_parsed_commit::twophase_gid, xl_xact_parsed_commit::twophase_xid, xl_xact_parsed_commit::xact_time, xl_xact_prepare::xid, and xl_xact_parsed_commit::xlocators.
Referenced by xact_decode(), and xact_desc_prepare().
bool PrepareTransactionBlock | ( | const char * | gid | ) |
Definition at line 3914 of file xact.c.
References Assert(), TransactionStateData::blockState, CurrentTransactionState, EndTransactionBlock(), MemoryContextStrdup(), TransactionStateData::parent, prepareGID, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, and TopTransactionContext.
Referenced by apply_handle_prepare_internal(), and standard_ProcessUtility().
void PreventInTransactionBlock | ( | bool | isTopLevel, |
const char * | stmtType | ||
) |
Definition at line 3557 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsSubTransaction(), IsTransactionBlock(), MyXactFlags, TBLOCK_DEFAULT, TBLOCK_STARTED, XACT_FLAGS_NEEDIMMEDIATECOMMIT, and XACT_FLAGS_PIPELINING.
Referenced by AlterDatabase(), AlterSubscription(), cluster(), CreateSubscription(), DiscardAll(), DropSubscription(), exec_replication_command(), ExecDropStmt(), ExecReindex(), ProcessUtilitySlow(), ReindexPartitions(), standard_ProcessUtility(), and vacuum().
void RegisterSubXactCallback | ( | SubXactCallback | callback, |
void * | arg | ||
) |
Definition at line 3786 of file xact.c.
References SubXactCallbackItem::arg, arg, SubXactCallbackItem::callback, callback(), MemoryContextAlloc(), SubXactCallbackItem::next, SubXact_callbacks, and TopMemoryContext.
Referenced by _PG_init(), GetConnection(), and sepgsql_init_client_label().
void RegisterXactCallback | ( | XactCallback | callback, |
void * | arg | ||
) |
Definition at line 3726 of file xact.c.
References XactCallbackItem::arg, arg, XactCallbackItem::callback, callback(), MemoryContextAlloc(), XactCallbackItem::next, TopMemoryContext, and Xact_callbacks.
Referenced by _PG_init(), GetConnection(), and sepgsql_init_client_label().
void ReleaseCurrentSubTransaction | ( | void | ) |
Definition at line 4687 of file xact.c.
References Assert(), TransactionStateData::blockState, BlockStateAsString(), CommitSubTransaction(), CurrentTransactionState, CurTransactionContext, elog, ereport, errcode(), errmsg(), ERROR, IsInParallelMode(), MemoryContextSwitchTo(), TransactionStateData::state, TBLOCK_SUBINPROGRESS, and TRANS_INPROGRESS.
Referenced by exec_stmt_block(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), pltcl_subtrans_commit(), pltcl_subtransaction(), PLy_spi_subtransaction_commit(), and PLy_subtransaction_exit().
void ReleaseSavepoint | ( | const char * | name | ) |
Definition at line 4380 of file xact.c.
References Assert(), TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), TransactionStateData::name, name, TransactionStateData::parent, PointerIsValid, TransactionStateData::savepointLevel, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, and TBLOCK_SUBRESTART.
Referenced by standard_ProcessUtility().
void RequireTransactionBlock | ( | bool | isTopLevel, |
const char * | stmtType | ||
) |
Definition at line 3635 of file xact.c.
References CheckTransactionBlock().
Referenced by PerformCursorOpen(), and standard_ProcessUtility().
void RestoreTransactionCharacteristics | ( | const SavedTransactionCharacteristics * | s | ) |
Definition at line 3040 of file xact.c.
References SavedTransactionCharacteristics::save_XactDeferrable, SavedTransactionCharacteristics::save_XactIsoLevel, SavedTransactionCharacteristics::save_XactReadOnly, XactDeferrable, XactIsoLevel, and XactReadOnly.
Referenced by _SPI_commit(), _SPI_rollback(), and CommitTransactionCommandInternal().
void RollbackAndReleaseCurrentSubTransaction | ( | void | ) |
Definition at line 4721 of file xact.c.
References AbortSubTransaction(), Assert(), TransactionStateData::blockState, BlockStateAsString(), CleanupSubTransaction(), CurrentTransactionState, elog, FATAL, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, and TBLOCK_SUBRESTART.
Referenced by exec_stmt_block(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), pltcl_subtrans_abort(), pltcl_subtransaction(), PLy_abort_open_subtransactions(), PLy_spi_subtransaction_abort(), PLy_subtransaction_exit(), ReorderBufferImmediateInvalidation(), and ReorderBufferProcessTXN().
void RollbackToSavepoint | ( | const char * | name | ) |
Definition at line 4489 of file xact.c.
References Assert(), TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), TransactionStateData::name, name, TransactionStateData::parent, PointerIsValid, TransactionStateData::savepointLevel, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, and TBLOCK_SUBRESTART.
Referenced by pa_stream_abort(), and standard_ProcessUtility().
void SaveTransactionCharacteristics | ( | SavedTransactionCharacteristics * | s | ) |
Definition at line 3032 of file xact.c.
References SavedTransactionCharacteristics::save_XactDeferrable, SavedTransactionCharacteristics::save_XactIsoLevel, SavedTransactionCharacteristics::save_XactReadOnly, XactDeferrable, XactIsoLevel, and XactReadOnly.
Referenced by _SPI_commit(), _SPI_rollback(), and CommitTransactionCommandInternal().
void SerializeTransactionState | ( | Size | maxsize, |
char * | start_address | ||
) |
Definition at line 5462 of file xact.c.
References add_size(), Assert(), TransactionStateData::childXids, SerializedTransactionState::currentCommandId, currentCommandId, SerializedTransactionState::currentFullTransactionId, CurrentTransactionState, TransactionStateData::fullTransactionId, FullTransactionIdIsValid, i, TransactionStateData::nChildXids, nParallelCurrentXids, SerializedTransactionState::nParallelCurrentXids, palloc(), ParallelCurrentXids, SerializedTransactionState::parallelCurrentXids, TransactionStateData::parent, qsort, SerializedTransactionStateHeaderSize, SerializedTransactionState::topFullTransactionId, XactDeferrable, SerializedTransactionState::xactDeferrable, XactIsoLevel, SerializedTransactionState::xactIsoLevel, XactTopFullTransactionId, xidComparator(), and XidFromFullTransactionId.
Referenced by InitializeParallelDSM().
void SetCurrentStatementStartTimestamp | ( | void | ) |
Definition at line 900 of file xact.c.
References Assert(), GetCurrentTimestamp(), IsParallelWorker, and stmtStartTimestamp.
Referenced by autovac_report_activity(), autovac_report_workitem(), begin_replication_step(), initialize_worker_spi(), InitPostgres(), PostgresMain(), and worker_spi_main().
void SetParallelStartTimestamps | ( | TimestampTz | xact_ts, |
TimestampTz | stmt_ts | ||
) |
Definition at line 845 of file xact.c.
References Assert(), IsParallelWorker, stmtStartTimestamp, and xactStartTimestamp.
Referenced by ParallelWorkerMain().
void StartParallelWorkerTransaction | ( | char * | tstatespace | ) |
Definition at line 5533 of file xact.c.
References Assert(), TransactionStateData::blockState, SerializedTransactionState::currentCommandId, currentCommandId, SerializedTransactionState::currentFullTransactionId, CurrentTransactionState, TransactionStateData::fullTransactionId, nParallelCurrentXids, SerializedTransactionState::nParallelCurrentXids, ParallelCurrentXids, SerializedTransactionState::parallelCurrentXids, StartTransaction(), TBLOCK_DEFAULT, TBLOCK_PARALLEL_INPROGRESS, SerializedTransactionState::topFullTransactionId, XactDeferrable, SerializedTransactionState::xactDeferrable, XactIsoLevel, SerializedTransactionState::xactIsoLevel, and XactTopFullTransactionId.
Referenced by ParallelWorkerMain().
void StartTransactionCommand | ( | void | ) |
Definition at line 2955 of file xact.c.
References Assert(), TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, CurTransactionContext, elog, ERROR, MemoryContextSwitchTo(), StartTransaction(), TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, and TBLOCK_SUBRESTART.
Referenced by _SPI_commit(), _SPI_rollback(), apply_handle_commit_internal(), ATExecDetachPartition(), autoprewarm_database_main(), bbsink_server_new(), begin_replication_step(), BeginInternalSubTransaction(), BootstrapModeMain(), clear_subscription_skip_lsn(), cluster(), cluster_multiple_rels(), DefineIndex(), DisableSubscriptionAndExit(), do_autovacuum(), EventTriggerOnLogin(), exec_replication_command(), FetchTableStates(), get_database_list(), get_subscription_list(), IdentifySystem(), index_drop(), initialize_worker_spi(), InitializeLogRepWorker(), InitPostgres(), LogicalRepSyncTableStart(), maybe_reread_subscription(), movedb(), pa_start_subtrans(), ParallelApplyWorkerMain(), ParallelWorkerMain(), perform_work_item(), pg_attribute_noreturn(), process_syncing_tables_for_apply(), process_syncing_tables_for_sync(), ProcessCatchupInterrupt(), ProcessIncomingNotify(), ReindexMultipleInternal(), ReindexRelationConcurrently(), RemoveTempRelationsCallback(), ReorderBufferProcessTXN(), run_apply_worker(), shell_check_detail(), SnapBuildExportSnapshot(), start_xact_command(), synchronize_slots(), vacuum(), vacuum_rel(), validate_remote_info(), and worker_spi_main().
bool SubTransactionIsActive | ( | SubTransactionId | subxid | ) |
Definition at line 795 of file xact.c.
References CurrentTransactionState, TransactionStateData::parent, TransactionStateData::state, TransactionStateData::subTransactionId, and TRANS_ABORT.
Referenced by fmgr_sql().
char TransactionBlockStatusCode | ( | void | ) |
Definition at line 4924 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, FATAL, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, and TBLOCK_SUBRESTART.
Referenced by ReadyForQuery().
bool TransactionIdIsCurrentTransactionId | ( | TransactionId | xid | ) |
Definition at line 927 of file xact.c.
References TransactionStateData::childXids, CurrentTransactionState, TransactionStateData::fullTransactionId, FullTransactionIdIsValid, GetTopTransactionIdIfAny(), TransactionStateData::nChildXids, nParallelCurrentXids, ParallelCurrentXids, TransactionStateData::parent, TransactionStateData::state, TRANS_ABORT, TransactionIdEquals, TransactionIdIsNormal, TransactionIdPrecedes(), and XidFromFullTransactionId.
Referenced by compute_new_xmax_infomask(), Do_MultiXactIdWait(), DoesMultiXactIdConflict(), ExecCheckTupleVisible(), ExecMergeMatched(), ExecOnConflictUpdate(), FreezeMultiXactId(), heap_delete(), heap_lock_tuple(), heap_update(), heapam_index_build_range_scan(), heapam_relation_copy_for_cluster(), heapam_scan_analyze_next_tuple(), heapam_tuple_lock(), HeapTupleHeaderAdjustCmax(), HeapTupleHeaderGetCmax(), HeapTupleHeaderGetCmin(), HeapTupleHeaderIsOnlyLocked(), HeapTupleSatisfiesDirty(), HeapTupleSatisfiesMVCC(), HeapTupleSatisfiesSelf(), HeapTupleSatisfiesToast(), HeapTupleSatisfiesUpdate(), HeapTupleSatisfiesVacuumHorizon(), MultiXactIdIsRunning(), PredicateLockTID(), RI_FKey_fk_upd_check_required(), SnapBuildWaitSnapshot(), test_lockmode_for_conflict(), and TransactionIdIsInProgress().
void UnregisterSubXactCallback | ( | SubXactCallback | callback, |
void * | arg | ||
) |
Definition at line 3799 of file xact.c.
References SubXactCallbackItem::arg, arg, SubXactCallbackItem::callback, callback(), SubXactCallbackItem::next, pfree(), and SubXact_callbacks.
void UnregisterXactCallback | ( | XactCallback | callback, |
void * | arg | ||
) |
Definition at line 3739 of file xact.c.
References XactCallbackItem::arg, arg, XactCallbackItem::callback, callback(), XactCallbackItem::next, pfree(), and Xact_callbacks.
void UserAbortTransactionBlock | ( | bool | chain | ) |
Definition at line 4126 of file xact.c.
References Assert(), TransactionStateData::blockState, BlockStateAsString(), TransactionStateData::chain, CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, TransactionStateData::parent, TBLOCK_ABORT, TBLOCK_ABORT_END, TBLOCK_ABORT_PENDING, TBLOCK_BEGIN, TBLOCK_DEFAULT, TBLOCK_END, TBLOCK_IMPLICIT_INPROGRESS, TBLOCK_INPROGRESS, TBLOCK_PARALLEL_INPROGRESS, TBLOCK_PREPARE, TBLOCK_STARTED, TBLOCK_SUBABORT, TBLOCK_SUBABORT_END, TBLOCK_SUBABORT_PENDING, TBLOCK_SUBABORT_RESTART, TBLOCK_SUBBEGIN, TBLOCK_SUBCOMMIT, TBLOCK_SUBINPROGRESS, TBLOCK_SUBRELEASE, TBLOCK_SUBRESTART, and WARNING.
Referenced by standard_ProcessUtility().
void WarnNoTransactionBlock | ( | bool | isTopLevel, |
const char * | stmtType | ||
) |
Definition at line 3629 of file xact.c.
References CheckTransactionBlock().
Referenced by ExecSetVariableStmt(), and standard_ProcessUtility().
void xact_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 436 of file xactdesc.c.
References appendStringInfo(), buf, InvalidOid, xl_xact_invals::msgs, xl_xact_invals::nmsgs, standby_desc_invalidations(), xact_desc_abort(), xact_desc_assignment(), xact_desc_commit(), xact_desc_prepare(), XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_INVALIDATIONS, XLOG_XACT_OPMASK, XLOG_XACT_PREPARE, XLogRecGetData, XLogRecGetInfo, XLogRecGetOrigin, and xl_xact_assignment::xtop.
const char* xact_identify | ( | uint8 | info | ) |
Definition at line 484 of file xactdesc.c.
References XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_INVALIDATIONS, XLOG_XACT_OPMASK, and XLOG_XACT_PREPARE.
void xact_redo | ( | XLogReaderState * | record | ) |
Definition at line 6285 of file xact.c.
References Assert(), elog, XLogReaderState::EndRecPtr, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), xl_xact_assignment::nsubxacts, PANIC, ParseAbortRecord(), ParseCommitRecord(), PrepareRedoAdd(), PrepareRedoRemove(), ProcArrayApplyXidAssignment(), XLogReaderState::ReadRecPtr, STANDBY_INITIALIZED, standbyState, xl_xact_parsed_commit::twophase_xid, xl_xact_parsed_abort::twophase_xid, xact_redo_abort(), xact_redo_commit(), XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_INVALIDATIONS, XLOG_XACT_OPMASK, XLOG_XACT_PREPARE, XLogRecGetData, XLogRecGetInfo, XLogRecGetOrigin, XLogRecGetXid, XLogRecHasAnyBlockRefs, xl_xact_assignment::xsub, and xl_xact_assignment::xtop.
int xactGetCommittedChildren | ( | TransactionId ** | ptr | ) |
Definition at line 5712 of file xact.c.
References TransactionStateData::childXids, CurrentTransactionState, and TransactionStateData::nChildXids.
Referenced by ExportSnapshot(), RecordTransactionAbort(), RecordTransactionCommit(), and StartPrepare().
XLogRecPtr XactLogAbortRecord | ( | TimestampTz | abort_time, |
int | nsubxacts, | ||
TransactionId * | subxacts, | ||
int | nrels, | ||
RelFileLocator * | rels, | ||
int | ndroppedstats, | ||
xl_xact_stats_item * | droppedstats, | ||
int | xactflags, | ||
TransactionId | twophase_xid, | ||
const char * | twophase_gid | ||
) |
Definition at line 5908 of file xact.c.
References Assert(), CritSectionCount, xl_xact_dbinfo::dbId, InvalidRepOriginId, MinSizeOfXactAbort, MinSizeOfXactRelfileLocators, MinSizeOfXactStatsItems, MinSizeOfXactSubxacts, MyDatabaseId, MyDatabaseTableSpace, xl_xact_stats_items::nitems, xl_xact_relfilelocators::nrels, xl_xact_subxacts::nsubxacts, xl_xact_origin::origin_lsn, xl_xact_origin::origin_timestamp, replorigin_session_origin, replorigin_session_origin_lsn, replorigin_session_origin_timestamp, TransactionIdIsValid, xl_xact_dbinfo::tsId, unconstify, XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK, xl_xact_abort::xact_time, XACT_XINFO_HAS_AE_LOCKS, XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_DROPPED_STATS, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILELOCATORS, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, XLOG_INCLUDE_ORIGIN, XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_HAS_INFO, XLogBeginInsert(), XLogInsert(), XLogLogicalInfoActive, XLogRegisterData(), XLogSetRecordFlags(), and XLR_SPECIAL_REL_UPDATE.
Referenced by RecordTransactionAbort(), and RecordTransactionAbortPrepared().
XLogRecPtr XactLogCommitRecord | ( | TimestampTz | commit_time, |
int | nsubxacts, | ||
TransactionId * | subxacts, | ||
int | nrels, | ||
RelFileLocator * | rels, | ||
int | ndroppedstats, | ||
xl_xact_stats_item * | droppedstats, | ||
int | nmsgs, | ||
SharedInvalidationMessage * | msgs, | ||
bool | relcacheInval, | ||
int | xactflags, | ||
TransactionId | twophase_xid, | ||
const char * | twophase_gid | ||
) |
Definition at line 5736 of file xact.c.
References Assert(), CritSectionCount, xl_xact_dbinfo::dbId, forceSyncCommit, InvalidRepOriginId, MinSizeOfXactInvals, MinSizeOfXactRelfileLocators, MinSizeOfXactStatsItems, MinSizeOfXactSubxacts, MyDatabaseId, MyDatabaseTableSpace, xl_xact_stats_items::nitems, xl_xact_invals::nmsgs, xl_xact_relfilelocators::nrels, xl_xact_subxacts::nsubxacts, xl_xact_origin::origin_lsn, xl_xact_origin::origin_timestamp, replorigin_session_origin, replorigin_session_origin_lsn, replorigin_session_origin_timestamp, synchronous_commit, SYNCHRONOUS_COMMIT_REMOTE_APPLY, TransactionIdIsValid, xl_xact_dbinfo::tsId, unconstify, XACT_COMPLETION_APPLY_FEEDBACK, XACT_COMPLETION_FORCE_SYNC_COMMIT, XACT_COMPLETION_UPDATE_RELCACHE_FILE, XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK, xl_xact_commit::xact_time, XACT_XINFO_HAS_AE_LOCKS, XACT_XINFO_HAS_DBINFO, XACT_XINFO_HAS_DROPPED_STATS, XACT_XINFO_HAS_GID, XACT_XINFO_HAS_INVALS, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILELOCATORS, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, XLOG_INCLUDE_ORIGIN, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_HAS_INFO, XLogBeginInsert(), XLogInsert(), XLogLogicalInfoActive, XLogRegisterData(), XLogSetRecordFlags(), and XLR_SPECIAL_REL_UPDATE.
Referenced by RecordTransactionCommit(), and RecordTransactionCommitPrepared().
|
extern |
Definition at line 98 of file xact.c.
Referenced by heap_getnext(), ResetLogicalStreamingState(), systable_beginscan(), systable_endscan(), table_index_fetch_tuple(), table_scan_bitmap_next_block(), table_scan_bitmap_next_tuple(), table_scan_getnextslot(), table_scan_sample_next_block(), table_scan_sample_next_tuple(), table_tuple_fetch_row_version(), and table_tuple_get_latest_tid().
|
extern |
Definition at line 97 of file xact.c.
Referenced by HandleConcurrentAbort(), heap_getnext(), ReorderBufferProcessTXN(), ReorderBufferStreamCommit(), ResetLogicalStreamingState(), SetupCheckXidLive(), systable_beginscan(), systable_endscan(), table_index_fetch_tuple(), table_scan_bitmap_next_block(), table_scan_bitmap_next_tuple(), table_scan_getnextslot(), table_scan_sample_next_block(), table_scan_sample_next_tuple(), table_tuple_fetch_row_version(), and table_tuple_get_latest_tid().
|
extern |
Definition at line 82 of file xact.c.
Referenced by StartTransaction().
|
extern |
Definition at line 76 of file xact.c.
Referenced by StartTransaction().
|
extern |
Definition at line 79 of file xact.c.
Referenced by StartTransaction().
|
extern |
Definition at line 134 of file xact.c.
Referenced by AccessTempTableNamespace(), CreateExtensionInternal(), exec_execute_message(), exec_simple_query(), IsInTransactionBlock(), LogAccessExclusiveLock(), PreCommit_on_commit_actions(), PrepareTransaction(), PreventInTransactionBlock(), RangeVarCallbackForLockTable(), RecordTransactionAbort(), RecordTransactionAbortPrepared(), RecordTransactionCommit(), RecordTransactionCommitPrepared(), relation_open(), RemoveObjects(), StartTransaction(), and try_relation_open().
|
extern |
Definition at line 85 of file xact.c.
Referenced by AutoVacWorkerMain(), RecordTransactionCommit(), and XactLogCommitRecord().
|
extern |
Definition at line 288 of file xact.c.
Referenced by check_log_duration(), and StartTransaction().
|
extern |
Definition at line 83 of file xact.c.
Referenced by GetSafeSnapshot(), GetSerializableTransactionSnapshot(), RestoreTransactionCharacteristics(), SaveTransactionCharacteristics(), SerializeTransactionState(), SetSerializableTransactionSnapshot(), StartParallelWorkerTransaction(), and StartTransaction().
|
extern |
Definition at line 77 of file xact.c.
Referenced by check_transaction_isolation(), CreateReplicationSlot(), ExportSnapshot(), InitPostgres(), RestoreTransactionCharacteristics(), SaveTransactionCharacteristics(), SerializeTransactionState(), SnapBuildExportSnapshot(), SnapBuildInitialSnapshot(), StartParallelWorkerTransaction(), and StartTransaction().
|
extern |
Definition at line 80 of file xact.c.
Referenced by AbortSubTransaction(), check_transaction_read_only(), CommitSubTransaction(), CreateReplicationSlot(), DoCopy(), ExportSnapshot(), GetSafeSnapshot(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), ImportSnapshot(), PreventCommandIfReadOnly(), PushTransaction(), RestoreTransactionCharacteristics(), SaveTransactionCharacteristics(), SetSerializableTransactionSnapshot(), SnapBuildExportSnapshot(), standard_ExecutorStart(), standard_ProcessUtility(), and StartTransaction().