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 3305 of file xact.c.
References AbortSubTransaction(), AbortTransaction(), TransactionStateData::blockState, CleanupSubTransaction(), CleanupTransaction(), CurrentTransactionState, TransactionStateData::state, 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 _SPI_commit(), _SPI_rollback(), AutoVacLauncherMain(), pa_stream_abort(), PostgresMain(), ReorderBufferImmediateInvalidation(), ReorderBufferProcessTXN(), and SnapBuildClearExportedSnapshot().
void AbortOutOfAnyTransaction | ( | void | ) |
Definition at line 4712 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 4172 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 4540 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 3770 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 1078 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(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), ATInheritAdjustNotNulls(), ATParseTransformCmd(), ATRewriteTables(), AttachPartitionEnsureIndexes(), btadjustmembers(), CloneFkReferencing(), CommitSubTransaction(), CommitTransactionCommand(), 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(), SetDefaultACL(), SetMatViewPopulatedState(), shdepReassignOwned(), SPI_cursor_open_internal(), standard_ProcessUtility(), StoreConstraints(), StorePartitionBound(), tryAttachPartitionForeignKey(), vacuum(), and validatePartitionedIndex().
void CommitTransactionCommand | ( | void | ) |
Definition at line 3034 of file xact.c.
References AbortSubTransaction(), AbortTransaction(), Assert(), TransactionStateData::blockState, BlockStateAsString(), TransactionStateData::chain, CleanupSubTransaction(), CleanupTransaction(), CommandCounterIncrement(), CommitSubTransaction(), CommitTransaction(), CurrentTransactionState, DefineSavepoint(), elog(), ERROR, FATAL, TransactionStateData::name, name, TransactionStateData::parent, PrepareTransaction(), RestoreTransactionCharacteristics(), TransactionStateData::savepointLevel, SaveTransactionCharacteristics(), StartSubTransaction(), 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(), 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(), 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(), vacuum(), vacuum_rel(), and worker_spi_main().
void DefineSavepoint | ( | const char * | name | ) |
Definition at line 4219 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 CommitTransactionCommand(), pa_start_subtrans(), and standard_ProcessUtility().
void EndImplicitTransactionBlock | ( | void | ) |
Definition at line 4197 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 5467 of file xact.c.
References Assert(), TransactionStateData::blockState, CommitTransaction(), CurrentTransactionState, TBLOCK_DEFAULT, and TBLOCK_PARALLEL_INPROGRESS.
Referenced by ParallelWorkerMain().
Definition at line 3890 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 1036 of file xact.c.
References Assert(), CurrentTransactionState, and TransactionStateData::parallelModeLevel.
Referenced by _bt_begin_parallel(), CommitTransaction(), ExecutePlan(), parallel_vacuum_init(), and ParallelWorkerMain().
Size EstimateTransactionStateSpace | ( | void | ) |
Definition at line 5343 of file xact.c.
References add_size(), CurrentTransactionState, TransactionStateData::fullTransactionId, FullTransactionIdIsValid, mul_size(), TransactionStateData::nChildXids, TransactionStateData::parent, and SerializedTransactionStateHeaderSize.
Referenced by InitializeParallelDSM().
void ExitParallelMode | ( | void | ) |
Definition at line 1049 of file xact.c.
References Assert(), CurrentTransactionState, ParallelContextActive(), and TransactionStateData::parallelModeLevel.
Referenced by _bt_begin_parallel(), _bt_end_parallel(), ExecutePlan(), parallel_vacuum_end(), and ParallelWorkerMain().
void ForceSyncCommit | ( | void | ) |
Definition at line 1128 of file xact.c.
References forceSyncCommit.
Referenced by createdb(), CreateTableSpace(), dropdb(), DropTableSpace(), and movedb().
Definition at line 818 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 503 of file xact.c.
References AssignTransactionId(), CurrentTransactionState, TransactionStateData::fullTransactionId, and FullTransactionIdIsValid.
FullTransactionId GetCurrentFullTransactionIdIfAny | ( | void | ) |
Definition at line 521 of file xact.c.
References CurrentTransactionState, and TransactionStateData::fullTransactionId.
TimestampTz GetCurrentStatementStartTimestamp | ( | void | ) |
Definition at line 864 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 780 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 445 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 462 of file xact.c.
References CurrentTransactionState, TransactionStateData::fullTransactionId, and XidFromFullTransactionId.
Referenced by IsSubxactTopXidLogPending(), RecordTransactionAbort(), ReorderBufferProcessTXN(), and XLogRecordAssemble().
int GetCurrentTransactionNestLevel | ( | void | ) |
Definition at line 914 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 855 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 876 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 598 of file xact.c.
References Assert(), GetTopTransactionIdIfAny(), InvalidLocalTransactionId, InvalidTransactionId, PGPROC::lxid, MyProc, ReadNextTransactionId(), and TransactionIdIsValid.
Referenced by xid_age().
FullTransactionId GetTopFullTransactionId | ( | void | ) |
Definition at line 474 of file xact.c.
References AssignTransactionId(), FullTransactionIdIsValid, TopTransactionStateData, and XactTopFullTransactionId.
Referenced by pg_current_xact_id().
FullTransactionId GetTopFullTransactionIdIfAny | ( | void | ) |
Definition at line 490 of file xact.c.
References XactTopFullTransactionId.
Referenced by pg_current_xact_id_if_assigned().
TransactionId GetTopTransactionId | ( | void | ) |
Definition at line 417 of file xact.c.
References AssignTransactionId(), FullTransactionIdIsValid, TopTransactionStateData, XactTopFullTransactionId, and XidFromFullTransactionId.
Referenced by AlterSequence(), AssignTransactionId(), do_setval(), fill_seq_fork_with_data(), log_heap_new_cid(), nextval_internal(), and SequenceChangePersistence().
TransactionId GetTopTransactionIdIfAny | ( | void | ) |
Definition at line 432 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 398 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 1069 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_option_ext(), SetReindexPending(), standard_ExecutorStart(), standard_ProcessUtility(), and UpdateActiveSnapshotCommandId().
Definition at line 3612 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 4889 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 550 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 4816 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 4834 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 378 of file xact.c.
References CurrentTransactionState, TransactionStateData::state, and TRANS_INPROGRESS.
Referenced by apply_handle_commit_internal(), apply_handle_origin(), 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(), and stream_stop_internal().
void MarkCurrentTransactionIdLoggedIfAny | ( | void | ) |
Definition at line 532 of file xact.c.
References CurrentTransactionState, TransactionStateData::didLogXid, TransactionStateData::fullTransactionId, and FullTransactionIdIsValid.
Referenced by XLogInsertRecord().
void MarkSubxactTopXidLogged | ( | void | ) |
Definition at line 582 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(), 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(), 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 3838 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 3481 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 3710 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 3650 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 4611 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 4304 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 3559 of file xact.c.
References CheckTransactionBlock().
Referenced by PerformCursorOpen(), and standard_ProcessUtility().
void RestoreTransactionCharacteristics | ( | const SavedTransactionCharacteristics * | s | ) |
Definition at line 3022 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 CommitTransactionCommand().
void RollbackAndReleaseCurrentSubTransaction | ( | void | ) |
Definition at line 4645 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 4413 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 3014 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 CommitTransactionCommand().
void SerializeTransactionState | ( | Size | maxsize, |
char * | start_address | ||
) |
Definition at line 5371 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 899 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 844 of file xact.c.
References Assert(), IsParallelWorker, stmtStartTimestamp, and xactStartTimestamp.
Referenced by ParallelWorkerMain().
void StartParallelWorkerTransaction | ( | char * | tstatespace | ) |
Definition at line 5442 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 2937 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(), 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(), vacuum(), vacuum_rel(), and worker_spi_main().
bool SubTransactionIsActive | ( | SubTransactionId | subxid | ) |
Definition at line 794 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 4848 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 926 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 3723 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 3663 of file xact.c.
References XactCallbackItem::arg, arg, XactCallbackItem::callback, callback(), XactCallbackItem::next, pfree(), and Xact_callbacks.
void UserAbortTransactionBlock | ( | bool | chain | ) |
Definition at line 4050 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 3553 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 6185 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 5612 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 5808 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 5636 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 100 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 99 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 84 of file xact.c.
Referenced by StartTransaction().
|
extern |
Definition at line 78 of file xact.c.
Referenced by StartTransaction().
|
extern |
Definition at line 81 of file xact.c.
Referenced by StartTransaction().
|
extern |
Definition at line 136 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 87 of file xact.c.
Referenced by AutoVacWorkerMain(), RecordTransactionCommit(), and XactLogCommitRecord().
|
extern |
Definition at line 290 of file xact.c.
Referenced by check_log_duration(), and StartTransaction().
|
extern |
Definition at line 85 of file xact.c.
Referenced by GetSafeSnapshot(), GetSerializableTransactionSnapshot(), RestoreTransactionCharacteristics(), SaveTransactionCharacteristics(), SerializeTransactionState(), SetSerializableTransactionSnapshot(), StartParallelWorkerTransaction(), and StartTransaction().
|
extern |
Definition at line 79 of file xact.c.
Referenced by check_transaction_isolation(), CreateReplicationSlot(), ExportSnapshot(), InitPostgres(), RestoreTransactionCharacteristics(), SaveTransactionCharacteristics(), SerializeTransactionState(), SnapBuildExportSnapshot(), SnapBuildInitialSnapshot(), StartParallelWorkerTransaction(), and StartTransaction().
|
extern |
Definition at line 82 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().