Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1fd515

Browse files
committed
Move WAL-related definitions from dbcommands.h to separate header file.
This makes it easier to write frontend programs that needs to understandthe WAL record format of CREATE/DROP DATABASE. dbcommands.h cannot easilybe #included in a frontend program, because it pulls in other header filesthat need backend stuff, but the new dbcommands_xlog.h header file hasfewer dependencies.
1 parentb9e538b commitf1fd515

File tree

6 files changed

+48
-27
lines changed

6 files changed

+48
-27
lines changed

‎contrib/pg_xlogdump/rmgrdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include"access/xact.h"
2323
#include"access/xlog_internal.h"
2424
#include"catalog/storage_xlog.h"
25-
#include"commands/dbcommands.h"
25+
#include"commands/dbcommands_xlog.h"
2626
#include"commands/sequence.h"
2727
#include"commands/tablespace.h"
2828
#include"rmgrdesc.h"

‎src/backend/access/rmgrdesc/dbasedesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
#include"postgres.h"
1616

17-
#include"commands/dbcommands.h"
17+
#include"commands/dbcommands_xlog.h"
1818
#include"lib/stringinfo.h"
1919

2020

‎src/backend/access/transam/rmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include"access/xact.h"
2121
#include"access/xlog_internal.h"
2222
#include"catalog/storage_xlog.h"
23-
#include"commands/dbcommands.h"
23+
#include"commands/dbcommands_xlog.h"
2424
#include"commands/sequence.h"
2525
#include"commands/tablespace.h"
2626
#include"storage/standby.h"

‎src/backend/commands/dbcommands.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include"catalog/pg_tablespace.h"
4141
#include"commands/comment.h"
4242
#include"commands/dbcommands.h"
43+
#include"commands/dbcommands_xlog.h"
4344
#include"commands/defrem.h"
4445
#include"commands/seclabel.h"
4546
#include"commands/tablespace.h"

‎src/include/commands/dbcommands.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,6 @@
1919
#include"lib/stringinfo.h"
2020
#include"nodes/parsenodes.h"
2121

22-
/* XLOG stuff */
23-
#defineXLOG_DBASE_CREATE0x00
24-
#defineXLOG_DBASE_DROP0x10
25-
26-
typedefstructxl_dbase_create_rec
27-
{
28-
/* Records copying of a single subdirectory incl. contents */
29-
Oiddb_id;
30-
Oidtablespace_id;
31-
Oidsrc_db_id;
32-
Oidsrc_tablespace_id;
33-
}xl_dbase_create_rec;
34-
35-
typedefstructxl_dbase_drop_rec
36-
{
37-
/* Records dropping of a single subdirectory incl. contents */
38-
Oiddb_id;
39-
Oidtablespace_id;
40-
}xl_dbase_drop_rec;
41-
4222
externOidcreatedb(constCreatedbStmt*stmt);
4323
externvoiddropdb(constchar*dbname,boolmissing_ok);
4424
externObjectAddressRenameDatabase(constchar*oldname,constchar*newname);
@@ -49,10 +29,6 @@ extern ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
4929
externOidget_database_oid(constchar*dbname,boolmissingok);
5030
externchar*get_database_name(Oiddbid);
5131

52-
externvoiddbase_redo(XLogReaderState*rptr);
53-
externvoiddbase_desc(StringInfobuf,XLogReaderState*rptr);
54-
externconstchar*dbase_identify(uint8info);
55-
5632
externvoidcheck_encoding_locale_matches(intencoding,constchar*collate,constchar*ctype);
5733

5834
#endif/* DBCOMMANDS_H */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* dbcommands_xlog.h
4+
*Database resource manager XLOG definitions (create/drop database).
5+
*
6+
*
7+
* Portions Copyright (c) 1996-2015, 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+
#ifndefDBCOMMANDS_XLOG_H
15+
#defineDBCOMMANDS_XLOG_H
16+
17+
#include"access/xlogreader.h"
18+
#include"lib/stringinfo.h"
19+
20+
/* record types */
21+
#defineXLOG_DBASE_CREATE0x00
22+
#defineXLOG_DBASE_DROP0x10
23+
24+
typedefstructxl_dbase_create_rec
25+
{
26+
/* Records copying of a single subdirectory incl. contents */
27+
Oiddb_id;
28+
Oidtablespace_id;
29+
Oidsrc_db_id;
30+
Oidsrc_tablespace_id;
31+
}xl_dbase_create_rec;
32+
33+
typedefstructxl_dbase_drop_rec
34+
{
35+
/* Records dropping of a single subdirectory incl. contents */
36+
Oiddb_id;
37+
Oidtablespace_id;
38+
}xl_dbase_drop_rec;
39+
40+
externvoiddbase_redo(XLogReaderState*rptr);
41+
externvoiddbase_desc(StringInfobuf,XLogReaderState*rptr);
42+
externconstchar*dbase_identify(uint8info);
43+
44+
#endif/* DBCOMMANDS_XLOG_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp