PostgreSQL Source Code  git master
xact.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * xact.h
4  * postgres transaction system definitions
5  *
6  *
7  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/xact.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef XACT_H
15 #define XACT_H
16 
17 #include "access/transam.h"
18 #include "access/xlogreader.h"
19 #include "datatype/timestamp.h"
20 #include "lib/stringinfo.h"
21 #include "nodes/pg_list.h"
22 #include "storage/relfilenode.h"
23 #include "storage/sinval.h"
24 
25 /*
26  * Maximum size of Global Transaction ID (including '\0').
27  *
28  * Note that the max value of GIDSIZE must fit in the uint16 gidlen,
29  * specified in TwoPhaseFileHeader.
30  */
31 #define GIDSIZE 200
32 
33 /*
34  * Xact isolation levels
35  */
36 #define XACT_READ_UNCOMMITTED 0
37 #define XACT_READ_COMMITTED 1
38 #define XACT_REPEATABLE_READ 2
39 #define XACT_SERIALIZABLE 3
40 
41 extern int DefaultXactIsoLevel;
42 extern PGDLLIMPORT int XactIsoLevel;
43 
44 /*
45  * We implement three isolation levels internally.
46  * The two stronger ones use one snapshot per database transaction;
47  * the others use one snapshot per statement.
48  * Serializable uses predicate locks in addition to snapshots.
49  * These macros should be used to check which isolation level is selected.
50  */
51 #define IsolationUsesXactSnapshot() (XactIsoLevel >= XACT_REPEATABLE_READ)
52 #define IsolationIsSerializable() (XactIsoLevel == XACT_SERIALIZABLE)
53 
54 /* Xact read-only state */
55 extern bool DefaultXactReadOnly;
56 extern bool XactReadOnly;
57 
58 /* flag for logging statements in this transaction */
59 extern bool xact_is_sampled;
60 
61 /*
62  * Xact is deferrable -- only meaningful (currently) for read only
63  * SERIALIZABLE transactions
64  */
65 extern bool DefaultXactDeferrable;
66 extern bool XactDeferrable;
67 
68 typedef enum
69 {
70  SYNCHRONOUS_COMMIT_OFF, /* asynchronous commit */
71  SYNCHRONOUS_COMMIT_LOCAL_FLUSH, /* wait for local flush only */
72  SYNCHRONOUS_COMMIT_REMOTE_WRITE, /* wait for local flush and remote
73  * write */
74  SYNCHRONOUS_COMMIT_REMOTE_FLUSH, /* wait for local and remote flush */
75  SYNCHRONOUS_COMMIT_REMOTE_APPLY /* wait for local flush and remote apply */
77 
78 /* Define the default setting for synchronous_commit */
79 #define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH
80 
81 /* Synchronous commit level */
82 extern int synchronous_commit;
83 
84 /* used during logical streaming of a transaction */
86 extern PGDLLIMPORT bool bsysscan;
87 
88 /*
89  * Miscellaneous flag bits to record events which occur on the top level
90  * transaction. These flags are only persisted in MyXactFlags and are intended
91  * so we remember to do certain things later in the transaction. This is
92  * globally accessible, so can be set from anywhere in the code which requires
93  * recording flags.
94  */
95 extern int MyXactFlags;
96 
97 /*
98  * XACT_FLAGS_ACCESSEDTEMPNAMESPACE - set when a temporary object is accessed.
99  * We don't allow PREPARE TRANSACTION in that case.
100  */
101 #define XACT_FLAGS_ACCESSEDTEMPNAMESPACE (1U << 0)
102 
103 /*
104  * XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK - records whether the top level xact
105  * logged any Access Exclusive Locks.
106  */
107 #define XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK (1U << 1)
108 
109 /*
110  * start- and end-of-transaction callbacks for dynamically loaded modules
111  */
112 typedef enum
113 {
122 } XactEvent;
123 
124 typedef void (*XactCallback) (XactEvent event, void *arg);
125 
126 typedef enum
127 {
132 } SubXactEvent;
133 
134 typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid,
135  SubTransactionId parentSubid, void *arg);
136 
137 
138 /* ----------------
139  * transaction-related XLOG entries
140  * ----------------
141  */
142 
143 /*
144  * XLOG allows to store some information in high 4 bits of log record xl_info
145  * field. We use 3 for the opcode, and one about an optional flag variable.
146  */
147 #define XLOG_XACT_COMMIT 0x00
148 #define XLOG_XACT_PREPARE 0x10
149 #define XLOG_XACT_ABORT 0x20
150 #define XLOG_XACT_COMMIT_PREPARED 0x30
151 #define XLOG_XACT_ABORT_PREPARED 0x40
152 #define XLOG_XACT_ASSIGNMENT 0x50
153 #define XLOG_XACT_INVALIDATIONS 0x60
154 /* free opcode 0x70 */
155 
156 /* mask for filtering opcodes out of xl_info */
157 #define XLOG_XACT_OPMASK 0x70
158 
159 /* does this record have a 'xinfo' field or not */
160 #define XLOG_XACT_HAS_INFO 0x80
161 
162 /*
163  * The following flags, stored in xinfo, determine which information is
164  * contained in commit/abort records.
165  */
166 #define XACT_XINFO_HAS_DBINFO (1U << 0)
167 #define XACT_XINFO_HAS_SUBXACTS (1U << 1)
168 #define XACT_XINFO_HAS_RELFILENODES (1U << 2)
169 #define XACT_XINFO_HAS_INVALS (1U << 3)
170 #define XACT_XINFO_HAS_TWOPHASE (1U << 4)
171 #define XACT_XINFO_HAS_ORIGIN (1U << 5)
172 #define XACT_XINFO_HAS_AE_LOCKS (1U << 6)
173 #define XACT_XINFO_HAS_GID (1U << 7)
174 
175 /*
176  * Also stored in xinfo, these indicating a variety of additional actions that
177  * need to occur when emulating transaction effects during recovery.
178  *
179  * They are named XactCompletion... to differentiate them from
180  * EOXact... routines which run at the end of the original transaction
181  * completion.
182  */
183 #define XACT_COMPLETION_APPLY_FEEDBACK (1U << 29)
184 #define XACT_COMPLETION_UPDATE_RELCACHE_FILE (1U << 30)
185 #define XACT_COMPLETION_FORCE_SYNC_COMMIT (1U << 31)
186 
187 /* Access macros for above flags */
188 #define XactCompletionApplyFeedback(xinfo) \
189  ((xinfo & XACT_COMPLETION_APPLY_FEEDBACK) != 0)
190 #define XactCompletionRelcacheInitFileInval(xinfo) \
191  ((xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE) != 0)
192 #define XactCompletionForceSyncCommit(xinfo) \
193  ((xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT) != 0)
194 
195 typedef struct xl_xact_assignment
196 {
197  TransactionId xtop; /* assigned XID's top-level XID */
198  int nsubxacts; /* number of subtransaction XIDs */
199  TransactionId xsub[FLEXIBLE_ARRAY_MEMBER]; /* assigned subxids */
201 
202 #define MinSizeOfXactAssignment offsetof(xl_xact_assignment, xsub)
203 
204 /*
205  * Commit and abort records can contain a lot of information. But a large
206  * portion of the records won't need all possible pieces of information. So we
207  * only include what's needed.
208  *
209  * A minimal commit/abort record only consists of a xl_xact_commit/abort
210  * struct. The presence of additional information is indicated by bits set in
211  * 'xl_xact_xinfo->xinfo'. The presence of the xinfo field itself is signaled
212  * by a set XLOG_XACT_HAS_INFO bit in the xl_info field.
213  *
214  * NB: All the individual data chunks should be sized to multiples of
215  * sizeof(int) and only require int32 alignment. If they require bigger
216  * alignment, they need to be copied upon reading.
217  */
218 
219 /* sub-records for commit/abort */
220 
221 typedef struct xl_xact_xinfo
222 {
223  /*
224  * Even though we right now only require 1 byte of space in xinfo we use
225  * four so following records don't have to care about alignment. Commit
226  * records can be large, so copying large portions isn't attractive.
227  */
229 } xl_xact_xinfo;
230 
231 typedef struct xl_xact_dbinfo
232 {
233  Oid dbId; /* MyDatabaseId */
234  Oid tsId; /* MyDatabaseTableSpace */
236 
237 typedef struct xl_xact_subxacts
238 {
239  int nsubxacts; /* number of subtransaction XIDs */
242 #define MinSizeOfXactSubxacts offsetof(xl_xact_subxacts, subxacts)
243 
244 typedef struct xl_xact_relfilenodes
245 {
246  int nrels; /* number of relations */
249 #define MinSizeOfXactRelfilenodes offsetof(xl_xact_relfilenodes, xnodes)
250 
251 typedef struct xl_xact_invals
252 {
253  int nmsgs; /* number of shared inval msgs */
256 #define MinSizeOfXactInvals offsetof(xl_xact_invals, msgs)
257 
258 typedef struct xl_xact_twophase
259 {
262 
263 typedef struct xl_xact_origin
264 {
268 
269 typedef struct xl_xact_commit
270 {
271  TimestampTz xact_time; /* time of commit */
272 
273  /* xl_xact_xinfo follows if XLOG_XACT_HAS_INFO */
274  /* xl_xact_dbinfo follows if XINFO_HAS_DBINFO */
275  /* xl_xact_subxacts follows if XINFO_HAS_SUBXACT */
276  /* xl_xact_relfilenodes follows if XINFO_HAS_RELFILENODES */
277  /* xl_xact_invals follows if XINFO_HAS_INVALS */
278  /* xl_xact_twophase follows if XINFO_HAS_TWOPHASE */
279  /* twophase_gid follows if XINFO_HAS_GID. As a null-terminated string. */
280  /* xl_xact_origin follows if XINFO_HAS_ORIGIN, stored unaligned! */
282 #define MinSizeOfXactCommit (offsetof(xl_xact_commit, xact_time) + sizeof(TimestampTz))
283 
284 typedef struct xl_xact_abort
285 {
286  TimestampTz xact_time; /* time of abort */
287 
288  /* xl_xact_xinfo follows if XLOG_XACT_HAS_INFO */
289  /* xl_xact_dbinfo follows if XINFO_HAS_DBINFO */
290  /* xl_xact_subxacts follows if XINFO_HAS_SUBXACT */
291  /* xl_xact_relfilenodes follows if XINFO_HAS_RELFILENODES */
292  /* No invalidation messages needed. */
293  /* xl_xact_twophase follows if XINFO_HAS_TWOPHASE */
294  /* twophase_gid follows if XINFO_HAS_GID. As a null-terminated string. */
295  /* xl_xact_origin follows if XINFO_HAS_ORIGIN, stored unaligned! */
296 } xl_xact_abort;
297 #define MinSizeOfXactAbort sizeof(xl_xact_abort)
298 
299 typedef struct xl_xact_prepare
300 {
301  uint32 magic; /* format identifier */
302  uint32 total_len; /* actual file length */
303  TransactionId xid; /* original transaction XID */
304  Oid database; /* OID of database it was in */
305  TimestampTz prepared_at; /* time of preparation */
306  Oid owner; /* user running the transaction */
307  int32 nsubxacts; /* number of following subxact XIDs */
308  int32 ncommitrels; /* number of delete-on-commit rels */
309  int32 nabortrels; /* number of delete-on-abort rels */
310  int32 ninvalmsgs; /* number of cache invalidation messages */
311  bool initfileinval; /* does relcache init file need invalidation? */
312  uint16 gidlen; /* length of the GID - GID follows the header */
313  XLogRecPtr origin_lsn; /* lsn of this record at origin node */
314  TimestampTz origin_timestamp; /* time of prepare at origin node */
316 
317 /*
318  * Commit/Abort records in the above form are a bit verbose to parse, so
319  * there's a deconstructed versions generated by ParseCommit/AbortRecord() for
320  * easier consumption.
321  */
322 typedef struct xl_xact_parsed_commit
323 {
326 
327  Oid dbId; /* MyDatabaseId */
328  Oid tsId; /* MyDatabaseTableSpace */
329 
332 
333  int nrels;
335 
336  int nmsgs;
338 
339  TransactionId twophase_xid; /* only for 2PC */
340  char twophase_gid[GIDSIZE]; /* only for 2PC */
341  int nabortrels; /* only for 2PC */
342  RelFileNode *abortnodes; /* only for 2PC */
343 
347 
349 
350 typedef struct xl_xact_parsed_abort
351 {
354 
355  Oid dbId; /* MyDatabaseId */
356  Oid tsId; /* MyDatabaseTableSpace */
357 
360 
361  int nrels;
363 
364  TransactionId twophase_xid; /* only for 2PC */
365  char twophase_gid[GIDSIZE]; /* only for 2PC */
366 
370 
371 
372 /* ----------------
373  * extern definitions
374  * ----------------
375  */
376 extern bool IsTransactionState(void);
377 extern bool IsAbortedTransactionBlockState(void);
388 extern void MarkCurrentTransactionIdLoggedIfAny(void);
389 extern bool SubTransactionIsActive(SubTransactionId subxid);
390 extern CommandId GetCurrentCommandId(bool used);
391 extern void SetParallelStartTimestamps(TimestampTz xact_ts, TimestampTz stmt_ts);
395 extern void SetCurrentStatementStartTimestamp(void);
396 extern int GetCurrentTransactionNestLevel(void);
398 extern void CommandCounterIncrement(void);
399 extern void ForceSyncCommit(void);
400 extern void StartTransactionCommand(void);
401 extern void SaveTransactionCharacteristics(void);
402 extern void RestoreTransactionCharacteristics(void);
403 extern void CommitTransactionCommand(void);
404 extern void AbortCurrentTransaction(void);
405 extern void BeginTransactionBlock(void);
406 extern bool EndTransactionBlock(bool chain);
407 extern bool PrepareTransactionBlock(const char *gid);
408 extern void UserAbortTransactionBlock(bool chain);
409 extern void BeginImplicitTransactionBlock(void);
410 extern void EndImplicitTransactionBlock(void);
411 extern void ReleaseSavepoint(const char *name);
412 extern void DefineSavepoint(const char *name);
413 extern void RollbackToSavepoint(const char *name);
414 extern void BeginInternalSubTransaction(const char *name);
415 extern void ReleaseCurrentSubTransaction(void);
417 extern bool IsSubTransaction(void);
419 extern void SerializeTransactionState(Size maxsize, char *start_address);
420 extern void StartParallelWorkerTransaction(char *tstatespace);
421 extern void EndParallelWorkerTransaction(void);
422 extern bool IsTransactionBlock(void);
423 extern bool IsTransactionOrTransactionBlock(void);
424 extern char TransactionBlockStatusCode(void);
425 extern void AbortOutOfAnyTransaction(void);
426 extern void PreventInTransactionBlock(bool isTopLevel, const char *stmtType);
427 extern void RequireTransactionBlock(bool isTopLevel, const char *stmtType);
428 extern void WarnNoTransactionBlock(bool isTopLevel, const char *stmtType);
429 extern bool IsInTransactionBlock(bool isTopLevel);
430 extern void RegisterXactCallback(XactCallback callback, void *arg);
431 extern void UnregisterXactCallback(XactCallback callback, void *arg);
434 
435 extern bool IsSubTransactionAssignmentPending(void);
436 extern void MarkSubTransactionAssigned(void);
437 
438 extern int xactGetCommittedChildren(TransactionId **ptr);
439 
440 extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
441  int nsubxacts, TransactionId *subxacts,
442  int nrels, RelFileNode *rels,
443  int nmsgs, SharedInvalidationMessage *msgs,
444  bool relcacheInval,
445  int xactflags,
446  TransactionId twophase_xid,
447  const char *twophase_gid);
448 
449 extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
450  int nsubxacts, TransactionId *subxacts,
451  int nrels, RelFileNode *rels,
452  int xactflags, TransactionId twophase_xid,
453  const char *twophase_gid);
454 extern void xact_redo(XLogReaderState *record);
455 
456 /* xactdesc.c */
457 extern void xact_desc(StringInfo buf, XLogReaderState *record);
458 extern const char *xact_identify(uint8 info);
459 
460 /* also in xactdesc.c, so they can be shared between front/backend code */
461 extern void ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed);
462 extern void ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed);
463 extern void ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *parsed);
464 
465 extern void EnterParallelMode(void);
466 extern void ExitParallelMode(void);
467 extern bool IsInParallelMode(void);
468 
469 #endif /* XACT_H */
bool IsTransactionOrTransactionBlock(void)
Definition: xact.c:4702
void EnterParallelMode(void)
Definition: xact.c:979
RelFileNode * xnodes
Definition: xact.h:334
int32 ninvalmsgs
Definition: xact.h:310
XLogRecPtr XactLogCommitRecord(TimestampTz commit_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileNode *rels, int nmsgs, SharedInvalidationMessage *msgs, bool relcacheInval, int xactflags, TransactionId twophase_xid, const char *twophase_gid)
Definition: xact.c:5501
void UnregisterSubXactCallback(SubXactCallback callback, void *arg)
Definition: xact.c:3596
struct xl_xact_parsed_commit xl_xact_parsed_commit
uint32 CommandId
Definition: c.h:534
PGDLLIMPORT TransactionId CheckXidAlive
Definition: xact.c:95
void EndImplicitTransactionBlock(void)
Definition: xact.c:4065
XactEvent
Definition: xact.h:112
const char * xact_identify(uint8 info)
Definition: xactdesc.c:409
void SaveTransactionCharacteristics(void)
Definition: xact.c:2927
struct xl_xact_parsed_abort xl_xact_parsed_abort
void AbortOutOfAnyTransaction(void)
Definition: xact.c:4580
int32 nsubxacts
Definition: xact.h:307
struct xl_xact_xinfo xl_xact_xinfo
FullTransactionId GetTopFullTransactionId(void)
Definition: xact.c:467
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3380
int GetCurrentTransactionNestLevel(void)
Definition: xact.c:857
uint32 TransactionId
Definition: c.h:520
int32 ncommitrels
Definition: xact.h:308
TransactionId GetTopTransactionIdIfAny(void)
Definition: xact.c:425
TimestampTz origin_timestamp
Definition: xact.h:345
bool IsTransactionBlock(void)
Definition: xact.c:4684
TimestampTz GetCurrentTransactionStopTimestamp(void)
Definition: xact.c:819
void ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *parsed)
Definition: xactdesc.c:34
void UserAbortTransactionBlock(bool chain)
Definition: xact.c:3918
void StartTransactionCommand(void)
Definition: xact.c:2846
void BeginInternalSubTransaction(const char *name)
Definition: xact.c:4408
int64 TimestampTz
Definition: timestamp.h:39
void(* SubXactCallback)(SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg)
Definition: xact.h:134
TransactionId xid
Definition: xact.h:260
TransactionId twophase_xid
Definition: xact.h:339
PGDLLIMPORT int XactIsoLevel
Definition: xact.c:75
unsigned char uint8
Definition: c.h:372
TransactionId * subxacts
Definition: xact.h:331
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:283
SharedInvalidationMessage * msgs
Definition: xact.h:337
TransactionId GetCurrentTransactionId(void)
Definition: xact.c:438
void ReleaseSavepoint(const char *name)
Definition: xact.c:4172
TransactionId xtop
Definition: xact.h:197
void SetParallelStartTimestamps(TimestampTz xact_ts, TimestampTz stmt_ts)
Definition: xact.c:787
XLogRecPtr origin_lsn
Definition: xact.h:344
uint16 gidlen
Definition: xact.h:312
TransactionId xsub[FLEXIBLE_ARRAY_MEMBER]
Definition: xact.h:199
void BeginImplicitTransactionBlock(void)
Definition: xact.c:4040
struct xl_xact_prepare xl_xact_prepare
FullTransactionId GetCurrentFullTransactionIdIfAny(void)
Definition: xact.c:514
uint32 SubTransactionId
Definition: c.h:524
struct xl_xact_dbinfo xl_xact_dbinfo
void ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed)
Definition: xactdesc.c:129
unsigned int Oid
Definition: postgres_ext.h:31
bool XactReadOnly
Definition: xact.c:78
bool XactDeferrable
Definition: xact.c:81
TimestampTz xact_time
Definition: xact.h:286
Oid tsId
Definition: xact.h:234
Oid database
Definition: xact.h:304
struct xl_xact_origin xl_xact_origin
void StartParallelWorkerTransaction(char *tstatespace)
Definition: xact.c:5306
SubTransactionId GetCurrentSubTransactionId(void)
Definition: xact.c:723
xl_xact_parsed_commit xl_xact_parsed_prepare
Definition: xact.h:348
#define PGDLLIMPORT
Definition: c.h:1257
signed int int32
Definition: c.h:362
int synchronous_commit
Definition: xact.c:83
void ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *parsed)
Definition: xactdesc.c:216
void(* XactCallback)(XactEvent event, void *arg)
Definition: xact.h:124
int32 nabortrels
Definition: xact.h:309
int MyXactFlags
Definition: xact.c:132
void BeginTransactionBlock(void)
Definition: xact.c:3638
unsigned short uint16
Definition: c.h:373
void CommandCounterIncrement(void)
Definition: xact.c:1021
void MarkCurrentTransactionIdLoggedIfAny(void)
Definition: xact.c:525
bool IsSubTransaction(void)
Definition: xact.c:4757
bool IsAbortedTransactionBlockState(void)
Definition: xact.c:391
bool SubTransactionIsActive(SubTransactionId subxid)
Definition: xact.c:737
void SetCurrentStatementStartTimestamp(void)
Definition: xact.c:833
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:48
#define GIDSIZE
Definition: xact.h:31
void AbortCurrentTransaction(void)
Definition: xact.c:3211
bool IsSubTransactionAssignmentPending(void)
Definition: xact.c:6079
bool DefaultXactReadOnly
Definition: xact.c:77
static char * buf
Definition: pg_test_fsync.c:68
TimestampTz xact_time
Definition: xact.h:271
XLogRecPtr origin_lsn
Definition: xact.h:313
bool EndTransactionBlock(bool chain)
Definition: xact.c:3758
struct xl_xact_commit xl_xact_commit
Size EstimateTransactionStateSpace(void)
Definition: xact.c:5208
void RegisterXactCallback(XactCallback callback, void *arg)
Definition: xact.c:3528
uint32 total_len
Definition: xact.h:302
struct xl_xact_twophase xl_xact_twophase
unsigned int uint32
Definition: c.h:374
void RestoreTransactionCharacteristics(void)
Definition: xact.c:2935
void RequireTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3446
XLogRecPtr origin_lsn
Definition: xact.h:265
TransactionId * subxacts
Definition: xact.h:359
struct xl_xact_invals xl_xact_invals
bool DefaultXactDeferrable
Definition: xact.c:80
void ReleaseCurrentSubTransaction(void)
Definition: xact.c:4479
struct xl_xact_abort xl_xact_abort
void UnregisterXactCallback(XactCallback callback, void *arg)
Definition: xact.c:3541
void DefineSavepoint(const char *name)
Definition: xact.c:4087
SubXactEvent
Definition: xact.h:126
void MarkSubTransactionAssigned(void)
Definition: xact.c:6107
void xact_desc(StringInfo buf, XLogReaderState *record)
Definition: xactdesc.c:363
int xactGetCommittedChildren(TransactionId **ptr)
Definition: xact.c:5477
void ForceSyncCommit(void)
Definition: xact.c:1071
uint32 xinfo
Definition: xact.h:228
XLogRecPtr origin_lsn
Definition: xact.h:367
bool PrepareTransactionBlock(const char *gid)
Definition: xact.c:3706
RelFileNode * xnodes
Definition: xact.h:362
int nsubxacts
Definition: xact.h:239
int DefaultXactIsoLevel
Definition: xact.c:74
void ExitParallelMode(void)
Definition: xact.c:992
SyncCommitLevel
Definition: xact.h:68
CommandId GetCurrentCommandId(bool used)
Definition: xact.c:761
void SerializeTransactionState(Size maxsize, char *start_address)
Definition: xact.c:5236
Oid dbId
Definition: xact.h:233
TransactionId twophase_xid
Definition: xact.h:364
struct xl_xact_assignment xl_xact_assignment
bool initfileinval
Definition: xact.h:311
void RollbackAndReleaseCurrentSubTransaction(void)
Definition: xact.c:4513
XLogRecPtr XactLogAbortRecord(TimestampTz abort_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileNode *rels, int xactflags, TransactionId twophase_xid, const char *twophase_gid)
Definition: xact.c:5657
RelFileNode * abortnodes
Definition: xact.h:342
bool TransactionIdIsCurrentTransactionId(TransactionId xid)
Definition: xact.c:869
uint64 XLogRecPtr
Definition: xlogdefs.h:21
void WarnNoTransactionBlock(bool isTopLevel, const char *stmtType)
Definition: xact.c:3440
TransactionId GetCurrentTransactionIdIfAny(void)
Definition: xact.c:455
TimestampTz origin_timestamp
Definition: xact.h:314
struct xl_xact_subxacts xl_xact_subxacts
TimestampTz GetCurrentStatementStartTimestamp(void)
Definition: xact.c:807
size_t Size
Definition: c.h:473
void CommitTransactionCommand(void)
Definition: xact.c:2947
FullTransactionId GetCurrentFullTransactionId(void)
Definition: xact.c:496
TimestampTz xact_time
Definition: xact.h:352
const char * name
Definition: encode.c:561
TransactionId xid
Definition: xact.h:303
bool IsInTransactionBlock(bool isTopLevel)
Definition: xact.c:3493
TimestampTz origin_timestamp
Definition: xact.h:266
struct xl_xact_relfilenodes xl_xact_relfilenodes
uint32 magic
Definition: xact.h:301
FullTransactionId GetTopFullTransactionIdIfAny(void)
Definition: xact.c:483
TransactionId GetTopTransactionId(void)
Definition: xact.c:410
void RegisterSubXactCallback(SubXactCallback callback, void *arg)
Definition: xact.c:3583
char TransactionBlockStatusCode(void)
Definition: xact.c:4716
void * arg
TimestampTz prepared_at
Definition: xact.h:305
void RollbackToSavepoint(const char *name)
Definition: xact.c:4281
PGDLLIMPORT bool bsysscan
Definition: xact.c:96
TimestampTz origin_timestamp
Definition: xact.h:368
void EndParallelWorkerTransaction(void)
Definition: xact.c:5331
int nmsgs
Definition: xact.h:253
bool IsInParallelMode(void)
Definition: xact.c:1012
void xact_redo(XLogReaderState *record)
Definition: xact.c:5984
bool xact_is_sampled
Definition: xact.c:283
TimestampTz GetCurrentTransactionStartTimestamp(void)
Definition: xact.c:798
TimestampTz xact_time
Definition: xact.h:324
TransactionId GetStableLatestTransactionId(void)
Definition: xact.c:541
bool IsTransactionState(void)
Definition: xact.c:371