PostgreSQL Source Code
git master
Loading...
Searching...
No Matches
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-2026, 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
*/
29
typedef
struct
xl_dbase_create_file_copy_rec
30
{
31
Oid
db_id
;
32
Oid
tablespace_id
;
33
Oid
src_db_id
;
34
Oid
src_tablespace_id
;
35
}
xl_dbase_create_file_copy_rec
;
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
*/
42
typedef
struct
xl_dbase_create_wal_log_rec
43
{
44
Oid
db_id
;
45
Oid
tablespace_id
;
46
}
xl_dbase_create_wal_log_rec
;
47
48
typedef
struct
xl_dbase_drop_rec
49
{
50
Oid
db_id
;
51
int
ntablespaces
;
/* number of tablespace IDs */
52
Oid
tablespace_ids
[
FLEXIBLE_ARRAY_MEMBER
];
53
}
xl_dbase_drop_rec
;
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 */
uint8
uint8_t uint8
Definition
c.h:544
FLEXIBLE_ARRAY_MEMBER
#define FLEXIBLE_ARRAY_MEMBER
Definition
c.h:480
dbase_identify
const char * dbase_identify(uint8 info)
Definition
dbasedesc.c:57
dbase_desc
void dbase_desc(StringInfo buf, XLogReaderState *record)
Definition
dbasedesc.c:22
dbase_redo
void dbase_redo(XLogReaderState *record)
Definition
dbcommands.c:3287
buf
static char buf[DEFAULT_XLOG_SEG_SIZE]
Definition
pg_test_fsync.c:71
Oid
unsigned int Oid
Definition
postgres_ext.h:32
stringinfo.h
StringInfoData
Definition
stringinfo.h:47
XLogReaderState
Definition
xlogreader.h:175
xl_dbase_create_file_copy_rec
Definition
dbcommands_xlog.h:30
xl_dbase_create_file_copy_rec::src_db_id
Oid src_db_id
Definition
dbcommands_xlog.h:33
xl_dbase_create_file_copy_rec::src_tablespace_id
Oid src_tablespace_id
Definition
dbcommands_xlog.h:34
xl_dbase_create_file_copy_rec::tablespace_id
Oid tablespace_id
Definition
dbcommands_xlog.h:32
xl_dbase_create_file_copy_rec::db_id
Oid db_id
Definition
dbcommands_xlog.h:31
xl_dbase_create_wal_log_rec
Definition
dbcommands_xlog.h:43
xl_dbase_create_wal_log_rec::tablespace_id
Oid tablespace_id
Definition
dbcommands_xlog.h:45
xl_dbase_create_wal_log_rec::db_id
Oid db_id
Definition
dbcommands_xlog.h:44
xl_dbase_drop_rec
Definition
dbcommands_xlog.h:49
xl_dbase_drop_rec::tablespace_ids
Oid tablespace_ids[FLEXIBLE_ARRAY_MEMBER]
Definition
dbcommands_xlog.h:52
xl_dbase_drop_rec::db_id
Oid db_id
Definition
dbcommands_xlog.h:50
xl_dbase_drop_rec::ntablespaces
int ntablespaces
Definition
dbcommands_xlog.h:51
xlogreader.h
src
include
commands
dbcommands_xlog.h
Generated on Sat Jan 31 2026 18:13:17 for PostgreSQL Source Code by
1.9.8