Header And Logo

PostgreSQL
| The world's most advanced open source database.

clog.h

Go to the documentation of this file.
00001 /*
00002  * clog.h
00003  *
00004  * PostgreSQL transaction-commit-log manager
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/access/clog.h
00010  */
00011 #ifndef CLOG_H
00012 #define CLOG_H
00013 
00014 #include "access/xlog.h"
00015 
00016 /*
00017  * Possible transaction statuses --- note that all-zeroes is the initial
00018  * state.
00019  *
00020  * A "subcommitted" transaction is a committed subtransaction whose parent
00021  * hasn't committed or aborted yet.
00022  */
00023 typedef int XidStatus;
00024 
00025 #define TRANSACTION_STATUS_IN_PROGRESS      0x00
00026 #define TRANSACTION_STATUS_COMMITTED        0x01
00027 #define TRANSACTION_STATUS_ABORTED          0x02
00028 #define TRANSACTION_STATUS_SUB_COMMITTED    0x03
00029 
00030 
00031 extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids,
00032                    TransactionId *subxids, XidStatus status, XLogRecPtr lsn);
00033 extern XidStatus TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn);
00034 
00035 extern Size CLOGShmemBuffers(void);
00036 extern Size CLOGShmemSize(void);
00037 extern void CLOGShmemInit(void);
00038 extern void BootStrapCLOG(void);
00039 extern void StartupCLOG(void);
00040 extern void TrimCLOG(void);
00041 extern void ShutdownCLOG(void);
00042 extern void CheckPointCLOG(void);
00043 extern void ExtendCLOG(TransactionId newestXact);
00044 extern void TruncateCLOG(TransactionId oldestXact);
00045 
00046 /* XLOG stuff */
00047 #define CLOG_ZEROPAGE       0x00
00048 #define CLOG_TRUNCATE       0x10
00049 
00050 extern void clog_redo(XLogRecPtr lsn, XLogRecord *record);
00051 extern void clog_desc(StringInfo buf, uint8 xl_info, char *rec);
00052 
00053 #endif   /* CLOG_H */