18
18
19
19
typedef struct
20
20
{
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 );
44
68
45
69
/* Detect distributed deadlock */
46
- bool (* DetectGlobalDeadLock )(PGPROC * proc );
70
+ bool (* DetectGlobalDeadLock ) (PGPROC * proc );
47
71
48
- char const * (* GetName )(void );
49
- } TransactionManager ;
72
+ char const * (* GetName ) (void );
73
+ } TransactionManager ;
50
74
51
75
/* Get pointer to transaction manager: actually returns content of TM variable */
52
- TransactionManager * GetTransactionManager (void );
76
+ TransactionManager * GetTransactionManager (void );
53
77
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) */
55
80
extern TransactionManager PgTM ; /* Standard PostgreSQL transaction manager */
56
81
57
82
/* Standard PostgreSQL function implementing TM interface */
58
83
extern bool PgXidInMVCCSnapshot (TransactionId xid , Snapshot snapshot );
59
84
60
85
extern void PgTransactionIdSetTreeStatus (TransactionId xid , int nsubxids ,
61
- TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
86
+ TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
62
87
extern XidStatus PgTransactionIdGetStatus (TransactionId xid , XLogRecPtr * lsn );
63
88
64
89
extern Snapshot PgGetSnapshotData (Snapshot snapshot );
@@ -71,8 +96,8 @@ extern TransactionId PgGetGlobalTransactionId(void);
71
96
72
97
extern TransactionId PgGetNewTransactionId (bool isSubXact );
73
98
74
- extern bool PgDetectGlobalDeadLock (PGPROC * proc );
99
+ extern bool PgDetectGlobalDeadLock (PGPROC * proc );
75
100
76
- extern char const * PgGetTransactionManagerName (void );
101
+ extern char const * PgGetTransactionManagerName (void );
77
102
78
103
#endif
0 commit comments