PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
clog.h
Go to the documentation of this file.
1 /*
2  * clog.h
3  *
4  * PostgreSQL transaction-commit-log manager
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/access/clog.h
10  */
11 #ifndef CLOG_H
12 #define CLOG_H
13 
14 #include "access/xlogreader.h"
15 #include "lib/stringinfo.h"
16 
17 /*
18  * Possible transaction statuses --- note that all-zeroes is the initial
19  * state.
20  *
21  * A "subcommitted" transaction is a committed subtransaction whose parent
22  * hasn't committed or aborted yet.
23  */
24 typedef int XidStatus;
25 
26 #define TRANSACTION_STATUS_IN_PROGRESS 0x00
27 #define TRANSACTION_STATUS_COMMITTED 0x01
28 #define TRANSACTION_STATUS_ABORTED 0x02
29 #define TRANSACTION_STATUS_SUB_COMMITTED 0x03
30 
31 
32 extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
33  TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
35 
36 extern Size CLOGShmemBuffers(void);
37 extern Size CLOGShmemSize(void);
38 extern void CLOGShmemInit(void);
39 extern void BootStrapCLOG(void);
40 extern void StartupCLOG(void);
41 extern void TrimCLOG(void);
42 extern void ShutdownCLOG(void);
43 extern void CheckPointCLOG(void);
44 extern void ExtendCLOG(TransactionId newestXact);
45 extern void TruncateCLOG(TransactionId oldestXact);
46 
47 /* XLOG stuff */
48 #define CLOG_ZEROPAGE 0x00
49 #define CLOG_TRUNCATE 0x10
50 
51 extern void clog_redo(XLogReaderState *record);
52 extern void clog_desc(StringInfo buf, XLogReaderState *record);
53 extern const char *clog_identify(uint8 info);
54 
55 #endif /* CLOG_H */
void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
Definition: clog.c:148
void TrimCLOG(void)
Definition: clog.c:525
void StartupCLOG(void)
Definition: clog.c:506
uint32 TransactionId
Definition: c.h:394
unsigned char uint8
Definition: c.h:263
void BootStrapCLOG(void)
Definition: clog.c:463
int XidStatus
Definition: clog.h:24
void clog_redo(XLogReaderState *record)
Definition: clog.c:721
void TruncateCLOG(TransactionId oldestXact)
Definition: clog.c:643
void ShutdownCLOG(void)
Definition: clog.c:574
const char * clog_identify(uint8 info)
Definition: clogdesc.c:36
static char * buf
Definition: pg_test_fsync.c:65
XidStatus TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn)
Definition: clog.c:392
void clog_desc(StringInfo buf, XLogReaderState *record)
Definition: clogdesc.c:21
void CheckPointCLOG(void)
Definition: clog.c:586
Size CLOGShmemSize(void)
Definition: clog.c:443
uint64 XLogRecPtr
Definition: xlogdefs.h:21
size_t Size
Definition: c.h:353
void ExtendCLOG(TransactionId newestXact)
Definition: clog.c:604
void CLOGShmemInit(void)
Definition: clog.c:449
static void static void status(const char *fmt,...) pg_attribute_printf(1
Definition: pg_regress.c:222
Size CLOGShmemBuffers(void)
Definition: clog.c:434