Header And Logo

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

storage_xlog.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * storage_xlog.h
00004  *    prototypes for XLog support for backend/catalog/storage.c
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/catalog/storage_xlog.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef STORAGE_XLOG_H
00015 #define STORAGE_XLOG_H
00016 
00017 #include "access/xlog.h"
00018 #include "storage/block.h"
00019 #include "storage/relfilenode.h"
00020 
00021 /*
00022  * Declarations for smgr-related XLOG records
00023  *
00024  * Note: we log file creation and truncation here, but logging of deletion
00025  * actions is handled by xact.c, because it is part of transaction commit.
00026  */
00027 
00028 /* XLOG gives us high 4 bits */
00029 #define XLOG_SMGR_CREATE    0x10
00030 #define XLOG_SMGR_TRUNCATE  0x20
00031 
00032 typedef struct xl_smgr_create
00033 {
00034     RelFileNode rnode;
00035     ForkNumber  forkNum;
00036 } xl_smgr_create;
00037 
00038 typedef struct xl_smgr_truncate
00039 {
00040     BlockNumber blkno;
00041     RelFileNode rnode;
00042 } xl_smgr_truncate;
00043 
00044 extern void log_smgrcreate(RelFileNode *rnode, ForkNumber forkNum);
00045 
00046 extern void smgr_redo(XLogRecPtr lsn, XLogRecord *record);
00047 extern void smgr_desc(StringInfo buf, uint8 xl_info, char *rec);
00048 
00049 #endif   /* STORAGE_XLOG_H */