]> granicus.if.org Git - postgresql/blob - src/include/commands/dbcommands.h
Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with
[postgresql] / src / include / commands / dbcommands.h
1 /*-------------------------------------------------------------------------
2  *
3  * dbcommands.h
4  *              Database management commands (create/drop database).
5  *
6  *
7  * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $PostgreSQL: pgsql/src/include/commands/dbcommands.h,v 1.46 2007/01/05 22:19:53 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef DBCOMMANDS_H
15 #define DBCOMMANDS_H
16
17 #include "access/xlog.h"
18 #include "nodes/parsenodes.h"
19
20 /* XLOG stuff */
21 #define XLOG_DBASE_CREATE               0x00
22 #define XLOG_DBASE_DROP                 0x10
23
24 typedef struct xl_dbase_create_rec_old
25 {
26         /* Records copying of a single subdirectory incl. contents */
27         Oid                     db_id;
28         char            src_path[1];    /* VARIABLE LENGTH STRING */
29         /* dst_path follows src_path */
30 } xl_dbase_create_rec_old;
31
32 typedef struct xl_dbase_drop_rec_old
33 {
34         /* Records dropping of a single subdirectory incl. contents */
35         Oid                     db_id;
36         char            dir_path[1];    /* VARIABLE LENGTH STRING */
37 } xl_dbase_drop_rec_old;
38
39 typedef struct xl_dbase_create_rec
40 {
41         /* Records copying of a single subdirectory incl. contents */
42         Oid                     db_id;
43         Oid                     tablespace_id;
44         Oid                     src_db_id;
45         Oid                     src_tablespace_id;
46 } xl_dbase_create_rec;
47
48 typedef struct xl_dbase_drop_rec
49 {
50         /* Records dropping of a single subdirectory incl. contents */
51         Oid                     db_id;
52         Oid                     tablespace_id;
53 } xl_dbase_drop_rec;
54
55 extern void createdb(const CreatedbStmt *stmt);
56 extern void dropdb(const char *dbname, bool missing_ok);
57 extern void RenameDatabase(const char *oldname, const char *newname);
58 extern void AlterDatabase(AlterDatabaseStmt *stmt);
59 extern void AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
60 extern void AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
61
62 extern Oid      get_database_oid(const char *dbname);
63 extern char *get_database_name(Oid dbid);
64
65 extern void dbase_redo(XLogRecPtr lsn, XLogRecord *rptr);
66 extern void dbase_desc(StringInfo buf, uint8 xl_info, char *rec);
67
68 #endif   /* DBCOMMANDS_H */