1818
1919typedef struct
2020{
21- /* Get current transaction status (encapsulation of TransactionIdGetStatus in clog.c) */
22- XidStatus (* GetTransactionStatus )(TransactionId xid , XLogRecPtr * lsn );
23-
24- /* Set current transaction status (encapsulation of TransactionIdSetTreeStatus in clog.c) */
25- void (* SetTransactionStatus )(TransactionId xid , int nsubxids , TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
26-
27- /* Get current transaction snaphot (encapsulation of GetSnapshotData in procarray.c) */
28- Snapshot (* GetSnapshot )(Snapshot snapshot );
29-
30- /* Assign new Xid to transaction (encapsulation of GetNewTransactionId in varsup.c) */
31- TransactionId (* GetNewTransactionId )(bool isSubXact );
32-
33- /* Get oldest transaction Xid that was running when any current transaction was started (encapsulation of GetOldestXmin in procarray.c) */
34- TransactionId (* GetOldestXmin )(Relation rel , bool ignoreVacuum );
35-
36- /* Check if current transaction is not yet completed (encapsulation of TransactionIdIsInProgress in procarray.c) */
37- bool (* IsInProgress )(TransactionId xid );
38-
39- /* Get global transaction XID: returns XID of current transaction if it is global, InvalidTransactionId otherwise */
40- TransactionId (* GetGlobalTransactionId )(void );
41-
42- /* Is the given XID still-in-progress according to the snapshot (encapsulation of XidInMVCCSnapshot in tqual.c) */
43- bool (* IsInSnapshot )(TransactionId xid , Snapshot snapshot );
21+ /*
22+ * Get current transaction status (encapsulation of TransactionIdGetStatus
23+ * in clog.c)
24+ */
25+ XidStatus (* GetTransactionStatus ) (TransactionId xid , XLogRecPtr * lsn );
26+
27+ /*
28+ * Set current transaction status (encapsulation of
29+ * TransactionIdSetTreeStatus in clog.c)
30+ */
31+ void (* SetTransactionStatus ) (TransactionId xid , int nsubxids , TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
32+
33+ /*
34+ * Get current transaction snaphot (encapsulation of GetSnapshotData in
35+ * procarray.c)
36+ */
37+ Snapshot (* GetSnapshot ) (Snapshot snapshot );
38+
39+ /*
40+ * Assign new Xid to transaction (encapsulation of GetNewTransactionId in
41+ * varsup.c)
42+ */
43+ TransactionId (* GetNewTransactionId ) (bool isSubXact );
44+
45+ /*
46+ * Get oldest transaction Xid that was running when any current
47+ * transaction was started (encapsulation of GetOldestXmin in procarray.c)
48+ */
49+ TransactionId (* GetOldestXmin ) (Relation rel , bool ignoreVacuum );
50+
51+ /*
52+ * Check if current transaction is not yet completed (encapsulation of
53+ * TransactionIdIsInProgress in procarray.c)
54+ */
55+ bool (* IsInProgress ) (TransactionId xid );
56+
57+ /*
58+ * Get global transaction XID: returns XID of current transaction if it is
59+ * global, InvalidTransactionId otherwise
60+ */
61+ TransactionId (* GetGlobalTransactionId ) (void );
62+
63+ /*
64+ * Is the given XID still-in-progress according to the snapshot
65+ * (encapsulation of XidInMVCCSnapshot in tqual.c)
66+ */
67+ bool (* IsInSnapshot ) (TransactionId xid , Snapshot snapshot );
4468
4569 /* Detect distributed deadlock */
46- bool (* DetectGlobalDeadLock )(PGPROC * proc );
70+ bool (* DetectGlobalDeadLock ) (PGPROC * proc );
4771
48- char const * (* GetName )(void );
49- } TransactionManager ;
72+ char const * (* GetName ) (void );
73+ } TransactionManager ;
5074
5175/* Get pointer to transaction manager: actually returns content of TM variable */
52- TransactionManager * GetTransactionManager (void );
76+ TransactionManager * GetTransactionManager (void );
5377
54- extern TransactionManager * TM ; /* Current transaction manager (can be substituted by extensions) */
78+ extern TransactionManager * TM ; /* Current transaction manager (can be
79+ * substituted by extensions) */
5580extern TransactionManager PgTM ; /* Standard PostgreSQL transaction manager */
5681
5782/* Standard PostgreSQL function implementing TM interface */
5883extern bool PgXidInMVCCSnapshot (TransactionId xid , Snapshot snapshot );
5984
6085extern void PgTransactionIdSetTreeStatus (TransactionId xid , int nsubxids ,
61- TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
86+ TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
6287extern XidStatus PgTransactionIdGetStatus (TransactionId xid , XLogRecPtr * lsn );
6388
6489extern Snapshot PgGetSnapshotData (Snapshot snapshot );
@@ -71,8 +96,8 @@ extern TransactionId PgGetGlobalTransactionId(void);
7196
7297extern TransactionId PgGetNewTransactionId (bool isSubXact );
7398
74- extern bool PgDetectGlobalDeadLock (PGPROC * proc );
99+ extern bool PgDetectGlobalDeadLock (PGPROC * proc );
75100
76- extern char const * PgGetTransactionManagerName (void );
101+ extern char const * PgGetTransactionManagerName (void );
77102
78103#endif
0 commit comments