1 /*-------------------------------------------------------------------------
4 * Database management commands (create/drop database).
7 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
12 *-------------------------------------------------------------------------
17 #include "access/xlog.h"
18 #include "nodes/parsenodes.h"
21 #define XLOG_DBASE_CREATE 0x00
22 #define XLOG_DBASE_DROP 0x10
24 typedef struct xl_dbase_create_rec_old
26 /* Records copying of a single subdirectory incl. contents */
28 char src_path
[1]; /* VARIABLE LENGTH STRING */
29 /* dst_path follows src_path */
30 } xl_dbase_create_rec_old
;
32 typedef struct xl_dbase_drop_rec_old
34 /* Records dropping of a single subdirectory incl. contents */
36 char dir_path
[1]; /* VARIABLE LENGTH STRING */
37 } xl_dbase_drop_rec_old
;
39 typedef struct xl_dbase_create_rec
41 /* Records copying of a single subdirectory incl. contents */
45 Oid src_tablespace_id
;
46 } xl_dbase_create_rec
;
48 typedef struct xl_dbase_drop_rec
50 /* Records dropping of a single subdirectory incl. contents */
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
, bool isTopLevel
);
59 extern void AlterDatabaseSet(AlterDatabaseSetStmt
*stmt
);
60 extern void AlterDatabaseOwner(const char *dbname
, Oid newOwnerId
);
62 extern Oid
get_database_oid(const char *dbname
);
63 extern char *get_database_name(Oid dbid
);
65 extern void dbase_redo(XLogRecPtr lsn
, XLogRecord
*rptr
);
66 extern void dbase_desc(StringInfo buf
, uint8 xl_info
, char *rec
);
68 #endif /* DBCOMMANDS_H */