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 typedef struct xl_clog_truncate
32 {
33  int pageno;
37 
38 extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
39  TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
41 
42 extern Size CLOGShmemBuffers(void);
43 extern Size CLOGShmemSize(void);
44 extern void CLOGShmemInit(void);
45 extern void BootStrapCLOG(void);
46 extern void StartupCLOG(void);
47 extern void TrimCLOG(void);
48 extern void ShutdownCLOG(void);
49 extern void CheckPointCLOG(void);
50 extern void ExtendCLOG(TransactionId newestXact);
51 extern void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid);
52 
53 /* XLOG stuff */
54 #define CLOG_ZEROPAGE 0x00
55 #define CLOG_TRUNCATE 0x10
56 
57 extern void clog_redo(XLogReaderState *record);
58 extern void clog_desc(StringInfo buf, XLogReaderState *record);
59 extern const char *clog_identify(uint8 info);
60 
61 #endif /* CLOG_H */
void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
Definition: clog.c:149
void TrimCLOG(void)
Definition: clog.c:526
void StartupCLOG(void)
Definition: clog.c:507
uint32 TransactionId
Definition: c.h:397
unsigned char uint8
Definition: c.h:266
void BootStrapCLOG(void)
Definition: clog.c:464
int XidStatus
Definition: clog.h:24
void clog_redo(XLogReaderState *record)
Definition: clog.c:759
unsigned int Oid
Definition: postgres_ext.h:31
void ShutdownCLOG(void)
Definition: clog.c:575
const char * clog_identify(uint8 info)
Definition: clogdesc.c:44
static char * buf
Definition: pg_test_fsync.c:66
XidStatus TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn)
Definition: clog.c:393
int pageno
Definition: clog.h:33
void clog_desc(StringInfo buf, XLogReaderState *record)
Definition: clogdesc.c:21
void CheckPointCLOG(void)
Definition: clog.c:594
TransactionId oldestXact
Definition: clog.h:34
Size CLOGShmemSize(void)
Definition: clog.c:444
uint64 XLogRecPtr
Definition: xlogdefs.h:21
size_t Size
Definition: c.h:356
void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid)
Definition: clog.c:658
void ExtendCLOG(TransactionId newestXact)
Definition: clog.c:619
Oid oldestXactDb
Definition: clog.h:35
void CLOGShmemInit(void)
Definition: clog.c:450
static void static void status(const char *fmt,...) pg_attribute_printf(1
Definition: pg_regress.c:224
struct xl_clog_truncate xl_clog_truncate
Size CLOGShmemBuffers(void)
Definition: clog.c:435