PostgreSQL Source Code
git master
|
#include "access/xlogreader.h"
#include "lib/stringinfo.h"
#include "nodes/pg_list.h"
#include "storage/relfilenode.h"
#include "storage/sinval.h"
#include "utils/datetime.h"
Go to the source code of this file.
Data Structures | |
struct | xl_xact_assignment |
struct | xl_xact_xinfo |
struct | xl_xact_dbinfo |
struct | xl_xact_subxacts |
struct | xl_xact_relfilenodes |
struct | xl_xact_invals |
struct | xl_xact_twophase |
struct | xl_xact_origin |
struct | xl_xact_commit |
struct | xl_xact_abort |
struct | xl_xact_parsed_commit |
struct | xl_xact_parsed_abort |
Typedefs | |
typedef void(* | XactCallback) (XactEvent event, void *arg) |
typedef void(* | SubXactCallback) (SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg) |
typedef struct xl_xact_assignment | xl_xact_assignment |
typedef struct xl_xact_xinfo | xl_xact_xinfo |
typedef struct xl_xact_dbinfo | xl_xact_dbinfo |
typedef struct xl_xact_subxacts | xl_xact_subxacts |
typedef struct xl_xact_relfilenodes | xl_xact_relfilenodes |
typedef struct xl_xact_invals | xl_xact_invals |
typedef struct xl_xact_twophase | xl_xact_twophase |
typedef struct xl_xact_origin | xl_xact_origin |
typedef struct xl_xact_commit | xl_xact_commit |
typedef struct xl_xact_abort | xl_xact_abort |
typedef struct xl_xact_parsed_commit | xl_xact_parsed_commit |
typedef xl_xact_parsed_commit | xl_xact_parsed_prepare |
typedef struct xl_xact_parsed_abort | xl_xact_parsed_abort |
Variables | |
int | DefaultXactIsoLevel |
PGDLLIMPORT int | XactIsoLevel |
bool | DefaultXactReadOnly |
bool | XactReadOnly |
bool | DefaultXactDeferrable |
bool | XactDeferrable |
int | synchronous_commit |
int | MyXactFlags |
#define GIDSIZE 200 |
Definition at line 30 of file xact.h.
Referenced by MarkAsPreparing().
#define IsolationIsSerializable | ( | ) | (XactIsoLevel == XACT_SERIALIZABLE) |
Definition at line 51 of file xact.h.
Referenced by begin_remote_xact(), CreateParallelContext(), GetSerializableTransactionSnapshot(), GetTransactionSnapshot(), ImportSnapshot(), PreCommit_CheckForSerializationFailure(), ReleasePredicateLocks(), SetSerializableTransactionSnapshot(), SetTransactionSnapshot(), and standard_planner().
#define IsolationUsesXactSnapshot | ( | ) | (XactIsoLevel >= XACT_REPEATABLE_READ) |
Definition at line 50 of file xact.h.
Referenced by bt_check_every_level(), EvalPlanQualFetch(), ExecCheckHeapTupleVisible(), ExecCheckTIDVisible(), ExecDelete(), ExecLockRows(), ExecOnConflictUpdate(), ExecUpdate(), GetTransactionSnapshot(), GetTupleForTrigger(), ImportSnapshot(), ri_PerformCheck(), and SetTransactionSnapshot().
#define MinSizeOfXactAbort sizeof(xl_xact_abort) |
Definition at line 289 of file xact.h.
Referenced by ParseAbortRecord(), and XactLogAbortRecord().
#define MinSizeOfXactAssignment offsetof(xl_xact_assignment, xsub) |
Definition at line 194 of file xact.h.
Referenced by AssignTransactionId().
#define MinSizeOfXactCommit (offsetof(xl_xact_commit, xact_time) + sizeof(TimestampTz)) |
Definition at line 274 of file xact.h.
Referenced by ParseCommitRecord().
#define MinSizeOfXactInvals offsetof(xl_xact_invals, msgs) |
Definition at line 248 of file xact.h.
Referenced by ParseCommitRecord(), and XactLogCommitRecord().
#define MinSizeOfXactRelfilenodes offsetof(xl_xact_relfilenodes, xnodes) |
Definition at line 241 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define MinSizeOfXactSubxacts offsetof(xl_xact_subxacts, subxacts) |
Definition at line 234 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH |
#define XACT_COMPLETION_APPLY_FEEDBACK (1U << 29) |
Definition at line 175 of file xact.h.
Referenced by XactLogCommitRecord().
#define XACT_COMPLETION_FORCE_SYNC_COMMIT (1U << 31) |
Definition at line 177 of file xact.h.
Referenced by XactLogCommitRecord().
#define XACT_COMPLETION_UPDATE_RELCACHE_FILE (1U << 30) |
Definition at line 176 of file xact.h.
Referenced by XactLogCommitRecord().
#define XACT_FLAGS_ACCESSEDTEMPNAMESPACE (1U << 0) |
Definition at line 93 of file xact.h.
Referenced by AccessTempTableNamespace(), CreateExtensionInternal(), PreCommit_on_commit_actions(), PrepareTransaction(), RangeVarCallbackForLockTable(), relation_open(), RemoveObjects(), and try_relation_open().
#define XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK (1U << 1) |
Definition at line 99 of file xact.h.
Referenced by LogAccessExclusiveLock(), RecordTransactionAbortPrepared(), RecordTransactionCommitPrepared(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_READ_COMMITTED 1 |
Definition at line 36 of file xact.h.
Referenced by InitPostgres().
#define XACT_REPEATABLE_READ 2 |
Definition at line 37 of file xact.h.
Referenced by CreateReplicationSlot(), SnapBuildExportSnapshot(), and SnapBuildInitialSnapshot().
#define XACT_SERIALIZABLE 3 |
Definition at line 38 of file xact.h.
Referenced by check_XactIsoLevel(), and ImportSnapshot().
#define XACT_XINFO_HAS_AE_LOCKS (1U << 6) |
Definition at line 164 of file xact.h.
Referenced by xact_redo_abort(), xact_redo_commit(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_DBINFO (1U << 0) |
Definition at line 158 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_GID (1U << 7) |
Definition at line 165 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_INVALS (1U << 3) |
Definition at line 161 of file xact.h.
Referenced by ParseCommitRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_ORIGIN (1U << 5) |
Definition at line 163 of file xact.h.
Referenced by DecodeCommit(), ParseAbortRecord(), ParseCommitRecord(), xact_desc_commit(), xact_redo_commit(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_RELFILENODES (1U << 2) |
Definition at line 160 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_SUBXACTS (1U << 1) |
Definition at line 159 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XACT_XINFO_HAS_TWOPHASE (1U << 4) |
Definition at line 162 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XactCompletionApplyFeedback | ( | xinfo | ) | ((xinfo & XACT_COMPLETION_APPLY_FEEDBACK) != 0) |
Definition at line 180 of file xact.h.
Referenced by xact_redo_commit().
#define XactCompletionForceSyncCommit | ( | xinfo | ) | ((xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT) != 0) |
Definition at line 184 of file xact.h.
Referenced by xact_desc_commit(), and xact_redo_commit().
#define XactCompletionRelcacheInitFileInval | ( | xinfo | ) | ((xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE) != 0) |
Definition at line 182 of file xact.h.
Referenced by xact_desc_commit(), and xact_redo_commit().
#define XLOG_XACT_ABORT 0x20 |
Definition at line 141 of file xact.h.
Referenced by DecodeXactOp(), getRecordTimestamp(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc(), xact_identify(), xact_redo(), and XactLogAbortRecord().
#define XLOG_XACT_ABORT_PREPARED 0x40 |
Definition at line 143 of file xact.h.
Referenced by DecodeXactOp(), getRecordTimestamp(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc(), xact_identify(), xact_redo(), and XactLogAbortRecord().
#define XLOG_XACT_ASSIGNMENT 0x50 |
Definition at line 144 of file xact.h.
Referenced by AssignTransactionId(), DecodeXactOp(), xact_desc(), xact_identify(), and xact_redo().
#define XLOG_XACT_COMMIT 0x00 |
Definition at line 139 of file xact.h.
Referenced by DecodeXactOp(), getRecordTimestamp(), recoveryApplyDelay(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc(), xact_identify(), xact_redo(), and XactLogCommitRecord().
#define XLOG_XACT_COMMIT_PREPARED 0x30 |
Definition at line 142 of file xact.h.
Referenced by DecodeXactOp(), getRecordTimestamp(), recoveryApplyDelay(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc(), xact_identify(), xact_redo(), and XactLogCommitRecord().
#define XLOG_XACT_HAS_INFO 0x80 |
Definition at line 152 of file xact.h.
Referenced by ParseAbortRecord(), ParseCommitRecord(), XactLogAbortRecord(), and XactLogCommitRecord().
#define XLOG_XACT_OPMASK 0x70 |
Definition at line 149 of file xact.h.
Referenced by DecodeXactOp(), getRecordTimestamp(), recoveryApplyDelay(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc(), xact_identify(), xact_redo(), and XlogReadTwoPhaseData().
#define XLOG_XACT_PREPARE 0x10 |
Definition at line 140 of file xact.h.
Referenced by DecodeXactOp(), EndPrepare(), xact_identify(), xact_redo(), and XlogReadTwoPhaseData().
typedef void(* SubXactCallback) (SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg) |
typedef struct xl_xact_abort xl_xact_abort |
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_xinfo xl_xact_xinfo |
enum SubXactEvent |
Enumerator | |
---|---|
SUBXACT_EVENT_START_SUB | |
SUBXACT_EVENT_COMMIT_SUB | |
SUBXACT_EVENT_ABORT_SUB | |
SUBXACT_EVENT_PRE_COMMIT_SUB |
enum SyncCommitLevel |
Enumerator | |
---|---|
SYNCHRONOUS_COMMIT_OFF | |
SYNCHRONOUS_COMMIT_LOCAL_FLUSH | |
SYNCHRONOUS_COMMIT_REMOTE_WRITE | |
SYNCHRONOUS_COMMIT_REMOTE_FLUSH | |
SYNCHRONOUS_COMMIT_REMOTE_APPLY |
enum XactEvent |
Enumerator | |
---|---|
XACT_EVENT_COMMIT | |
XACT_EVENT_PARALLEL_COMMIT | |
XACT_EVENT_ABORT | |
XACT_EVENT_PARALLEL_ABORT | |
XACT_EVENT_PREPARE | |
XACT_EVENT_PRE_COMMIT | |
XACT_EVENT_PARALLEL_PRE_COMMIT | |
XACT_EVENT_PRE_PREPARE |
Definition at line 104 of file xact.h.
void AbortCurrentTransaction | ( | void | ) |
Definition at line 3019 of file xact.c.
References AbortCurrentTransaction(), 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 AbortCurrentTransaction(), AutoVacLauncherMain(), PostgresMain(), ReorderBufferCommit(), ReorderBufferImmediateInvalidation(), SnapBuildClearExportedSnapshot(), and SPI_rollback().
void AbortOutOfAnyTransaction | ( | void | ) |
Definition at line 4353 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 do_autovacuum(), perform_work_item(), RemoveTempRelationsCallback(), and ShutdownPostgres().
void BeginImplicitTransactionBlock | ( | void | ) |
Definition at line 3813 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 4181 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CommitTransactionCommand(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), MemoryContextStrdup(), TransactionStateData::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(), ReorderBufferCommit(), and ReorderBufferImmediateInvalidation().
void BeginTransactionBlock | ( | void | ) |
Definition at line 3447 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 standard_ProcessUtility().
void CommandCounterIncrement | ( | void | ) |
Definition at line 919 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(), AddRoleMems(), AlterPublicationOptions(), AlterRole(), apply_handle_delete(), apply_handle_insert(), apply_handle_truncate(), apply_handle_update(), ATAddCheckConstraint(), ATExecAddColumn(), ATExecAlterColumnType(), ATExecCmd(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropIdentity(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), CloneFkReferencing(), CommitSubTransaction(), CommitTransactionCommand(), copy_heap_data(), create_ctas_internal(), create_toast_table(), CreateFKCheckTrigger(), createForeignKeyActionTriggers(), createForeignKeyTriggers(), CreateForeignTable(), CreatePublication(), CreateRole(), CreateSchemaCommand(), CreateTrigger(), DefineCollation(), DefineDomain(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineType(), DefineVirtualRelation(), deleteOneObject(), DelRoleMems(), DropRole(), EventTriggerDDLCommandEnd(), EventTriggerDDLCommandStart(), EventTriggerInvoke(), EventTriggerSQLDrop(), EventTriggerTableRewrite(), exec_eval_simple_expr(), exec_execute_message(), exec_parse_message(), exec_simple_query(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Largeobject(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), execute_sql_string(), ExplainOnePlan(), findTypeInputFunction(), findTypeOutputFunction(), fmgr_sql(), ImportForeignSchema(), index_build(), index_create(), IndexSetParentIndex(), InitTempTableNamespace(), inv_create(), inv_drop(), inv_truncate(), inv_write(), LogicalRepSyncTableStart(), make_new_heap(), makeConfigurationDependencies(), moveArrayTypeName(), OperatorShellMake(), OperatorUpd(), pg_import_system_collations(), PortalRunMulti(), ProcedureCreate(), ProcessUtilitySlow(), recordExtensionInitPrivWorker(), reindex_relation(), RelationSetNewRelfilenode(), RenumberEnumType(), replorigin_create(), replorigin_drop(), ri_PerformCheck(), SetMatViewPopulatedState(), shdepReassignOwned(), SPI_cursor_open_internal(), StoreConstraints(), StorePartitionBound(), and validatePartitionedIndex().
void CommitTransactionCommand | ( | void | ) |
Definition at line 2779 of file xact.c.
References AbortSubTransaction(), AbortTransaction(), Assert, AssertState, TransactionStateData::blockState, BlockStateAsString(), CleanupSubTransaction(), CleanupTransaction(), CommandCounterIncrement(), CommitSubTransaction(), CommitTransaction(), CommitTransactionCommand(), CurrentTransactionState, DefineSavepoint(), elog, ERROR, FATAL, TransactionStateData::name, TransactionStateData::parent, PrepareTransaction(), TransactionStateData::savepointLevel, StartSubTransaction(), 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 apply_handle_commit(), ApplyWorkerMain(), autoprewarm_database_main(), BeginInternalSubTransaction(), BootstrapModeMain(), cluster(), CommitTransactionCommand(), DefineIndex(), do_autovacuum(), finish_xact_command(), get_database_list(), get_subscription_list(), IdentifySystem(), index_drop(), initialize_worker_spi(), InitPostgres(), LogicalRepSyncTableStart(), maybe_reread_subscription(), movedb(), ParallelWorkerMain(), pg_attribute_noreturn(), process_syncing_tables_for_apply(), ProcessCatchupInterrupt(), ProcessCompletedNotifies(), ProcessIncomingNotify(), ReindexMultipleTables(), RemoveTempRelationsCallback(), SPI_commit(), vacuum(), and vacuum_rel().
void DefineSavepoint | ( | const char * | name | ) |
Definition at line 3860 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), MemoryContextStrdup(), TransactionStateData::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(), and standard_ProcessUtility().
void EndImplicitTransactionBlock | ( | void | ) |
Definition at line 3838 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 5106 of file xact.c.
References Assert, TransactionStateData::blockState, CommitTransaction(), TBLOCK_DEFAULT, and TBLOCK_PARALLEL_INPROGRESS.
Referenced by ParallelWorkerMain().
bool EndTransactionBlock | ( | void | ) |
Definition at line 3567 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), 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 PrepareTransactionBlock(), and standard_ProcessUtility().
void EnterParallelMode | ( | void | ) |
Definition at line 877 of file xact.c.
References Assert, CurrentTransactionState, and TransactionStateData::parallelModeLevel.
Referenced by _bt_begin_parallel(), CommitTransaction(), ExecutePlan(), and ParallelWorkerMain().
Size EstimateTransactionStateSpace | ( | void | ) |
Definition at line 4982 of file xact.c.
References add_size(), mul_size(), TransactionStateData::nChildXids, nParallelCurrentXids, TransactionStateData::parent, TransactionStateData::transactionId, and TransactionIdIsValid.
Referenced by InitializeParallelDSM().
void ExitParallelMode | ( | void | ) |
Definition at line 890 of file xact.c.
References Assert, CurrentTransactionState, ParallelContextActive(), and TransactionStateData::parallelModeLevel.
Referenced by _bt_end_parallel(), ExecutePlan(), and ParallelWorkerMain().
void ForceSyncCommit | ( | void | ) |
Definition at line 967 of file xact.c.
References forceSyncCommit.
Referenced by createdb(), CreateTableSpace(), dropdb(), DropTableSpace(), and movedb().
Definition at line 662 of file xact.c.
References Assert, currentCommandId, currentCommandIdUsed, and IsParallelWorker.
Referenced by ATRewriteTable(), CopyFrom(), create_estate_for_relation(), GetSnapshotData(), intorel_startup(), pgrowlocks(), RegisterRelcacheInvalidation(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), simple_heap_delete(), simple_heap_insert(), simple_heap_update(), standard_ExecutorStart(), toast_save_datum(), transientrel_startup(), and UpdateActiveSnapshotCommandId().
TimestampTz GetCurrentStatementStartTimestamp | ( | void | ) |
Definition at line 708 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 624 of file xact.c.
References CurrentTransactionState, and TransactionStateData::subTransactionId.
Referenced by _SPI_begin_call(), AllocateDir(), AllocateFile(), CopyFrom(), CreateParallelContext(), CreatePortal(), ExecuteTruncateGuts(), init_sql_fcache(), InitTempTableNamespace(), inv_open(), MarkPortalActive(), OpenPipeStream(), OpenTransientFilePerm(), plpgsql_create_econtext(), plpgsql_inline_handler(), register_on_commit_action(), RelationBuildLocalRelation(), RelationSetNewRelfilenode(), remove_on_commit_action(), sepgsql_set_client_label(), SPI_connect_ext(), and spi_dest_startup().
TransactionId GetCurrentTransactionId | ( | void | ) |
Definition at line 400 of file xact.c.
References AssignTransactionId(), CurrentTransactionState, TransactionStateData::transactionId, and TransactionIdIsValid.
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(), and ReorderBufferCommit().
TransactionId GetCurrentTransactionIdIfAny | ( | void | ) |
Definition at line 417 of file xact.c.
References TransactionStateData::transactionId.
Referenced by RecordTransactionAbort(), ReorderBufferCommit(), and XLogRecordAssemble().
int GetCurrentTransactionNestLevel | ( | void | ) |
Definition at line 758 of file xact.c.
References CurrentTransactionState, and TransactionStateData::nestingLevel.
Referenced by AfterTriggerBeginSubXact(), AfterTriggerEndSubXact(), AfterTriggerSetState(), AtEOSubXact_Inval(), AtEOSubXact_Namespace(), AtSubAbort_Notify(), AtSubCommit_Notify(), AtSubCommit_smgr(), AtSubStart_Notify(), begin_remote_xact(), logicalrep_worker_stop_at_commit(), pgfdw_subxact_callback(), pgstat_count_heap_delete(), pgstat_count_heap_insert(), pgstat_count_heap_update(), pgstat_count_truncate(), PopOverrideSearchPath(), PrepareInvalidationState(), PushActiveSnapshot(), PushOverrideSearchPath(), register_seq_scan(), RelationCreateStorage(), RelationDropStorage(), RelationMapUpdateMap(), smgrDoPendingDeletes(), and smgrGetPendingDeletes().
TimestampTz GetCurrentTransactionStartTimestamp | ( | void | ) |
Definition at line 699 of file xact.c.
References xactStartTimestamp.
Referenced by GetCurrentDateTime(), GetCurrentTimeUsec(), GetSQLCurrentDate(), GetSQLCurrentTime(), GetSQLCurrentTimestamp(), GetSQLLocalTime(), GetSQLLocalTimestamp(), InitializeParallelDSM(), now(), pg_timezone_abbrevs(), and pg_timezone_names().
TimestampTz GetCurrentTransactionStopTimestamp | ( | void | ) |
Definition at line 720 of file xact.c.
References GetCurrentTimestamp(), and xactStopTimestamp.
Referenced by pgstat_report_stat().
TransactionId GetStableLatestTransactionId | ( | void | ) |
Definition at line 444 of file xact.c.
References Assert, GetTopTransactionIdIfAny(), InvalidLocalTransactionId, InvalidTransactionId, PGPROC::lxid, MyProc, ReadNewTransactionId(), and TransactionIdIsValid.
Referenced by xid_age().
TransactionId GetTopTransactionId | ( | void | ) |
Definition at line 372 of file xact.c.
References AssignTransactionId(), TransactionIdIsValid, and XactTopTransactionId.
Referenced by AlterSequence(), AssignTransactionId(), do_setval(), fill_seq_with_data(), log_heap_new_cid(), nextval_internal(), and txid_current().
TransactionId GetTopTransactionIdIfAny | ( | void | ) |
Definition at line 387 of file xact.c.
References XactTopTransactionId.
Referenced by CheckForSerializableConflictOut(), ConditionalXactLockTableWait(), CreateInitDecodingContext(), ExportSnapshot(), GetSerializableTransactionSnapshotInt(), GetStableLatestTransactionId(), ImportSnapshot(), index_drop(), index_set_state_flags(), initSpGistState(), log_line_prefix(), PredicateLockTuple(), RecordTransactionCommit(), txid_current_if_assigned(), write_csvlog(), XactLockTableWait(), and XidIsConcurrent().
bool IsAbortedTransactionBlockState | ( | void | ) |
Definition at line 353 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, TBLOCK_ABORT, and TBLOCK_SUBABORT.
Referenced by errdetail_params(), 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 RecoveryConflictInterrupt().
bool IsInParallelMode | ( | void | ) |
Definition at line 910 of file xact.c.
References TransactionStateData::parallelModeLevel.
Referenced by _SPI_execute_plan(), AbortSubTransaction(), AbortTransaction(), AssignTransactionId(), BeginInternalSubTransaction(), check_xact_readonly(), CommandCounterIncrement(), CommitSubTransaction(), CommitTransaction(), CreateParallelContext(), DefineSavepoint(), ExecSetVariableStmt(), GetLatestSnapshot(), GetNewTransactionId(), GetSerializableTransactionSnapshotInt(), GetTransactionSnapshot(), heap_delete(), heap_inplace_update(), heap_update(), init_execution_state(), PrepareTransaction(), PreventAdvisoryLocksInParallelMode(), PreventCommandIfParallelMode(), RelationMapUpdateMap(), ReleaseCurrentSubTransaction(), ReleaseSavepoint(), RemoveReindexPending(), RollbackToSavepoint(), set_config_option(), SetReindexPending(), SPI_cursor_open_internal(), standard_ExecutorStart(), and UpdateActiveSnapshotCommandId().
Definition at line 3302 of file xact.c.
References TransactionStateData::blockState, IsSubTransaction(), IsTransactionBlock(), TBLOCK_DEFAULT, and TBLOCK_STARTED.
Referenced by vacuum().
bool IsSubTransaction | ( | void | ) |
Definition at line 4530 of file xact.c.
References CurrentTransactionState, and TransactionStateData::nestingLevel.
Referenced by AfterTriggerSetState(), check_transaction_deferrable(), check_transaction_read_only(), check_XactIsoLevel(), CheckTargetForConflictsIn(), CheckTransactionBlock(), CreateReplicationSlot(), ExportSnapshot(), ImportSnapshot(), IsInTransactionBlock(), PreventInTransactionBlock(), RecoveryConflictInterrupt(), SPI_commit(), and SPI_rollback().
bool IsTransactionBlock | ( | void | ) |
Definition at line 4457 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, TBLOCK_DEFAULT, and TBLOCK_STARTED.
Referenced by CheckTransactionBlock(), CreateReplicationSlot(), exec_replication_command(), IsInTransactionBlock(), PreventInTransactionBlock(), and standard_ProcessUtility().
bool IsTransactionOrTransactionBlock | ( | void | ) |
Definition at line 4475 of file xact.c.
References TransactionStateData::blockState, CurrentTransactionState, and TBLOCK_DEFAULT.
Referenced by PostgresMain(), ProcessCatchupInterrupt(), ProcessNotifyInterrupt(), RecoveryConflictInterrupt(), ReorderBufferCommit(), ReorderBufferImmediateInvalidation(), SnapBuildExportSnapshot(), and StartupDecodingContext().
bool IsTransactionState | ( | void | ) |
Definition at line 333 of file xact.c.
References CurrentTransactionState, TransactionStateData::state, and TRANS_INPROGRESS.
Referenced by apply_handle_commit(), apply_handle_origin(), check_client_encoding(), check_default_tablespace(), check_role(), check_session_authorization(), check_temp_tablespaces(), check_transaction_read_only(), check_TSCurrentConfig(), check_XactIsoLevel(), CreateInitDecodingContext(), ensure_transaction(), GetMessageEncoding(), LogLogicalMessage(), maybe_reread_subscription(), 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(), SearchCatCacheInternal(), SetMultiXactIdLimit(), SetTransactionIdLimit(), SnapBuildClearExportedSnapshot(), and SocketBackend().
void MarkCurrentTransactionIdLoggedIfAny | ( | void | ) |
Definition at line 428 of file xact.c.
References TransactionStateData::didLogXid, TransactionStateData::transactionId, and TransactionIdIsValid.
Referenced by XLogInsertRecord().
void ParseAbortRecord | ( | uint8 | info, |
xl_xact_abort * | xlrec, | ||
xl_xact_parsed_abort * | parsed | ||
) |
Definition at line 129 of file xactdesc.c.
References xl_xact_dbinfo::dbId, xl_xact_parsed_abort::dbId, MinSizeOfXactAbort, MinSizeOfXactRelfilenodes, MinSizeOfXactSubxacts, xl_xact_relfilenodes::nrels, xl_xact_parsed_abort::nrels, 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, 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_GID, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILENODES, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, xl_xact_parsed_abort::xinfo, XLOG_XACT_HAS_INFO, xl_xact_relfilenodes::xnodes, and xl_xact_parsed_abort::xnodes.
Referenced by DecodeXactOp(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc_abort(), and xact_redo().
void ParseCommitRecord | ( | uint8 | info, |
xl_xact_commit * | xlrec, | ||
xl_xact_parsed_commit * | parsed | ||
) |
Definition at line 34 of file xactdesc.c.
References xl_xact_dbinfo::dbId, xl_xact_parsed_commit::dbId, MinSizeOfXactCommit, MinSizeOfXactInvals, MinSizeOfXactRelfilenodes, MinSizeOfXactSubxacts, xl_xact_invals::msgs, xl_xact_parsed_commit::msgs, xl_xact_invals::nmsgs, xl_xact_parsed_commit::nmsgs, xl_xact_relfilenodes::nrels, xl_xact_parsed_commit::nrels, 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, 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_GID, XACT_XINFO_HAS_INVALS, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILENODES, XACT_XINFO_HAS_SUBXACTS, XACT_XINFO_HAS_TWOPHASE, xl_xact_twophase::xid, xl_xact_xinfo::xinfo, xl_xact_parsed_commit::xinfo, XLOG_XACT_HAS_INFO, xl_xact_relfilenodes::xnodes, and xl_xact_parsed_commit::xnodes.
Referenced by DecodeXactOp(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc_commit(), and xact_redo().
bool PrepareTransactionBlock | ( | const char * | gid | ) |
Definition at line 3515 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 standard_ProcessUtility().
void PreventInTransactionBlock | ( | bool | isTopLevel, |
const char * | stmtType | ||
) |
Definition at line 3188 of file xact.c.
References TransactionStateData::blockState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsSubTransaction(), IsTransactionBlock(), TBLOCK_DEFAULT, and TBLOCK_STARTED.
Referenced by AlterDatabase(), cluster(), CreateSubscription(), DiscardAll(), DropSubscription(), exec_replication_command(), ExecDropStmt(), ProcessUtilitySlow(), standard_ProcessUtility(), and vacuum().
void RegisterSubXactCallback | ( | SubXactCallback | callback, |
void * | arg | ||
) |
Definition at line 3392 of file xact.c.
References arg, SubXactCallbackItem::arg, callback(), SubXactCallbackItem::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 3337 of file xact.c.
References arg, XactCallbackItem::arg, callback(), XactCallbackItem::callback, MemoryContextAlloc(), XactCallbackItem::next, TopMemoryContext, and Xact_callbacks.
Referenced by _PG_init(), GetConnection(), and sepgsql_init_client_label().
void ReleaseCurrentSubTransaction | ( | void | ) |
Definition at line 4252 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 3945 of file xact.c.
References Assert, TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), TransactionStateData::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 3254 of file xact.c.
References CheckTransactionBlock().
Referenced by PerformCursorOpen(), and standard_ProcessUtility().
void RollbackAndReleaseCurrentSubTransaction | ( | void | ) |
Definition at line 4286 of file xact.c.
References AbortSubTransaction(), AssertState, 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(), ReorderBufferCommit(), and ReorderBufferImmediateInvalidation().
void RollbackToSavepoint | ( | const char * | name | ) |
Definition at line 4054 of file xact.c.
References Assert, TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), ERROR, FATAL, IsInParallelMode(), TransactionStateData::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 SerializeTransactionState | ( | Size | maxsize, |
char * | start_address | ||
) |
Definition at line 5015 of file xact.c.
References add_size(), Assert, TransactionStateData::childXids, currentCommandId, i, TransactionStateData::nChildXids, nParallelCurrentXids, palloc(), ParallelCurrentXids, TransactionStateData::parent, qsort, TransactionStateData::transactionId, TransactionIdIsValid, XactDeferrable, XactIsoLevel, XactTopTransactionId, and xidComparator().
Referenced by InitializeParallelDSM().
void SetCurrentStatementStartTimestamp | ( | void | ) |
Definition at line 734 of file xact.c.
References Assert, GetCurrentTimestamp(), IsParallelWorker, and stmtStartTimestamp.
Referenced by autovac_report_activity(), autovac_report_workitem(), ensure_transaction(), initialize_worker_spi(), InitPostgres(), and PostgresMain().
void SetParallelStartTimestamps | ( | TimestampTz | xact_ts, |
TimestampTz | stmt_ts | ||
) |
Definition at line 688 of file xact.c.
References Assert, IsParallelWorker, stmtStartTimestamp, and xactStartTimestamp.
Referenced by ParallelWorkerMain().
void StartParallelWorkerTransaction | ( | char * | tstatespace | ) |
Definition at line 5083 of file xact.c.
References Assert, TransactionStateData::blockState, currentCommandId, nParallelCurrentXids, ParallelCurrentXids, StartTransaction(), TBLOCK_DEFAULT, TBLOCK_PARALLEL_INPROGRESS, TransactionStateData::transactionId, XactDeferrable, XactIsoLevel, and XactTopTransactionId.
Referenced by ParallelWorkerMain().
void StartTransactionCommand | ( | void | ) |
Definition at line 2708 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 ApplyWorkerMain(), autoprewarm_database_main(), BeginInternalSubTransaction(), BootstrapModeMain(), cluster(), DefineIndex(), do_autovacuum(), ensure_transaction(), get_database_list(), get_subscription_list(), IdentifySystem(), index_drop(), initialize_worker_spi(), InitPostgres(), LogicalRepSyncTableStart(), maybe_reread_subscription(), movedb(), ParallelWorkerMain(), perform_work_item(), pg_attribute_noreturn(), process_syncing_tables_for_apply(), ProcessCatchupInterrupt(), ProcessCompletedNotifies(), ProcessIncomingNotify(), ReindexMultipleTables(), RemoveTempRelationsCallback(), ReorderBufferCommit(), SnapBuildExportSnapshot(), SPI_start_transaction(), start_xact_command(), vacuum(), and vacuum_rel().
bool SubTransactionIsActive | ( | SubTransactionId | subxid | ) |
Definition at line 638 of file xact.c.
References TransactionStateData::parent, TransactionStateData::state, TransactionStateData::subTransactionId, and TRANS_ABORT.
Referenced by fmgr_sql().
char TransactionBlockStatusCode | ( | void | ) |
Definition at line 4489 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 770 of file xact.c.
References TransactionStateData::childXids, TransactionStateData::nChildXids, nParallelCurrentXids, ParallelCurrentXids, TransactionStateData::parent, TransactionStateData::state, TRANS_ABORT, TransactionStateData::transactionId, TransactionIdEquals, TransactionIdIsNormal, TransactionIdIsValid, and TransactionIdPrecedes().
Referenced by acquire_sample_rows(), compute_new_xmax_infomask(), copy_heap_data(), Do_MultiXactIdWait(), DoesMultiXactIdConflict(), EvalPlanQualFetch(), ExecCheckHeapTupleVisible(), ExecOnConflictUpdate(), FreezeMultiXactId(), heap_delete(), heap_lock_tuple(), heap_update(), HeapTupleHeaderAdjustCmax(), HeapTupleHeaderGetCmax(), HeapTupleHeaderGetCmin(), HeapTupleHeaderIsOnlyLocked(), HeapTupleSatisfiesDirty(), HeapTupleSatisfiesMVCC(), HeapTupleSatisfiesSelf(), HeapTupleSatisfiesToast(), HeapTupleSatisfiesUpdate(), HeapTupleSatisfiesVacuum(), IndexBuildHeapRangeScan(), MultiXactIdIsRunning(), RI_FKey_fk_upd_check_required(), SnapBuildWaitSnapshot(), test_lockmode_for_conflict(), TransactionIdIsInProgress(), and txid_status().
void UnregisterSubXactCallback | ( | SubXactCallback | callback, |
void * | arg | ||
) |
Definition at line 3405 of file xact.c.
References SubXactCallbackItem::next, and pfree().
void UnregisterXactCallback | ( | XactCallback | callback, |
void * | arg | ||
) |
Definition at line 3350 of file xact.c.
References XactCallbackItem::next, and pfree().
void UserAbortTransactionBlock | ( | void | ) |
Definition at line 3703 of file xact.c.
References TransactionStateData::blockState, BlockStateAsString(), CurrentTransactionState, elog, ereport, errcode(), errmsg(), 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 3248 of file xact.c.
References CheckTransactionBlock().
Referenced by ExecSetVariableStmt(), and standard_ProcessUtility().
void xact_desc | ( | StringInfo | buf, |
XLogReaderState * | record | ||
) |
Definition at line 308 of file xactdesc.c.
References appendStringInfo(), xact_desc_abort(), xact_desc_assignment(), xact_desc_commit(), XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_OPMASK, XLogRecGetData, XLogRecGetInfo, XLogRecGetOrigin, and xl_xact_assignment::xtop.
const char* xact_identify | ( | uint8 | info | ) |
Definition at line 341 of file xactdesc.c.
References XLOG_XACT_ABORT, XLOG_XACT_ABORT_PREPARED, XLOG_XACT_ASSIGNMENT, XLOG_XACT_COMMIT, XLOG_XACT_COMMIT_PREPARED, XLOG_XACT_OPMASK, and XLOG_XACT_PREPARE.
void xact_redo | ( | XLogReaderState * | record | ) |
Definition at line 5789 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_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 5252 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, | ||
RelFileNode * | rels, | ||
int | xactflags, | ||
TransactionId | twophase_xid, | ||
const char * | twophase_gid | ||
) |
Definition at line 5431 of file xact.c.
References Assert, CritSectionCount, xl_xact_dbinfo::dbId, InvalidRepOriginId, MinSizeOfXactAbort, MinSizeOfXactRelfilenodes, MinSizeOfXactSubxacts, MyDatabaseId, MyDatabaseTableSpace, xl_xact_relfilenodes::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_GID, XACT_XINFO_HAS_ORIGIN, XACT_XINFO_HAS_RELFILENODES, 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(), and XLogSetRecordFlags().
Referenced by RecordTransactionAbort(), and RecordTransactionAbortPrepared().