PostgreSQL Source Code  git master
dbcommands_xlog.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * dbcommands_xlog.h
4  * Database resource manager XLOG definitions (create/drop database).
5  *
6  *
7  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/commands/dbcommands_xlog.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef DBCOMMANDS_XLOG_H
15 #define DBCOMMANDS_XLOG_H
16 
17 #include "access/xlogreader.h"
18 #include "lib/stringinfo.h"
19 
20 /* record types */
21 #define XLOG_DBASE_CREATE_FILE_COPY 0x00
22 #define XLOG_DBASE_CREATE_WAL_LOG 0x10
23 #define XLOG_DBASE_DROP 0x20
24 
25 /*
26  * Single WAL record for an entire CREATE DATABASE operation. This is used
27  * by the FILE_COPY strategy.
28  */
30 {
36 
37 /*
38  * WAL record for the beginning of a CREATE DATABASE operation, when the
39  * WAL_LOG strategy is used. Each individual block will be logged separately
40  * afterward.
41  */
43 {
47 
48 typedef struct xl_dbase_drop_rec
49 {
51  int ntablespaces; /* number of tablespace IDs */
54 #define MinSizeOfDbaseDropRec offsetof(xl_dbase_drop_rec, tablespace_ids)
55 
56 extern void dbase_redo(XLogReaderState *record);
57 extern void dbase_desc(StringInfo buf, XLogReaderState *record);
58 extern const char *dbase_identify(uint8 info);
59 
60 #endif /* DBCOMMANDS_XLOG_H */
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:362
unsigned char uint8
Definition: c.h:440
struct xl_dbase_create_wal_log_rec xl_dbase_create_wal_log_rec
struct xl_dbase_create_file_copy_rec xl_dbase_create_file_copy_rec
const char * dbase_identify(uint8 info)
Definition: dbasedesc.c:57
void dbase_desc(StringInfo buf, XLogReaderState *record)
Definition: dbasedesc.c:22
struct xl_dbase_drop_rec xl_dbase_drop_rec
void dbase_redo(XLogReaderState *record)
Definition: dbcommands.c:3041
static char * buf
Definition: pg_test_fsync.c:67
unsigned int Oid
Definition: postgres_ext.h:31
Oid tablespace_ids[FLEXIBLE_ARRAY_MEMBER]