4 * PostgreSQL transaction-commit-log manager
6 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/access/clog.h
14 #include "access/xlogreader.h"
15 #include "storage/sync.h"
16 #include "lib/stringinfo.h"
19 * Possible transaction statuses --- note that all-zeroes is the initial
22 * A "subcommitted" transaction is a committed subtransaction whose parent
23 * hasn't committed or aborted yet.
25 typedef int XidStatus
;
27 #define TRANSACTION_STATUS_IN_PROGRESS 0x00
28 #define TRANSACTION_STATUS_COMMITTED 0x01
29 #define TRANSACTION_STATUS_ABORTED 0x02
30 #define TRANSACTION_STATUS_SUB_COMMITTED 0x03
32 typedef struct xl_clog_truncate
35 TransactionId oldestXact
;
39 extern void TransactionIdSetTreeStatus(TransactionId xid
, int nsubxids
,
40 TransactionId
*subxids
, XidStatus status
, XLogRecPtr lsn
);
41 extern XidStatus
TransactionIdGetStatus(TransactionId xid
, XLogRecPtr
*lsn
);
43 extern Size
CLOGShmemBuffers(void);
44 extern Size
CLOGShmemSize(void);
45 extern void CLOGShmemInit(void);
46 extern void BootStrapCLOG(void);
47 extern void StartupCLOG(void);
48 extern void TrimCLOG(void);
49 extern void CheckPointCLOG(void);
50 extern void ExtendCLOG(TransactionId newestXact
);
51 extern void TruncateCLOG(TransactionId oldestXact
, Oid oldestxid_datoid
);
53 extern int clogsyncfiletag(const FileTag
*ftag
, char *path
);
56 #define CLOG_ZEROPAGE 0x00
57 #define CLOG_TRUNCATE 0x10
59 extern void clog_redo(XLogReaderState
*record
);
60 extern void clog_desc(StringInfo buf
, XLogReaderState
*record
);
61 extern const char *clog_identify(uint8 info
);