PostgreSQL Source Code  git master
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * dbcommands.h
4  * Database management commands (create/drop database).
5  *
6  *
7  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/commands/dbcommands.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef DBCOMMANDS_H
15 #define DBCOMMANDS_H
17 #include "access/xlogreader.h"
18 #include "catalog/objectaddress.h"
19 #include "lib/stringinfo.h"
20 #include "parser/parse_node.h"
22 extern Oid createdb(ParseState *pstate, const CreatedbStmt *stmt);
23 extern void dropdb(const char *dbname, bool missing_ok, bool force);
24 extern void DropDatabase(ParseState *pstate, DropdbStmt *stmt);
25 extern ObjectAddress RenameDatabase(const char *oldname, const char *newname);
26 extern Oid AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel);
29 extern ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
31 extern Oid get_database_oid(const char *dbname, bool missing_ok);
32 extern char *get_database_name(Oid dbid);
33 extern bool have_createdb_privilege(void);
35 extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype);
37 #endif /* DBCOMMANDS_H */
ObjectAddress AlterDatabaseRefreshColl(AlterDatabaseRefreshCollStmt *stmt)
Definition: dbcommands.c:2336
bool have_createdb_privilege(void)
Definition: dbcommands.c:2745
ObjectAddress RenameDatabase(const char *oldname, const char *newname)
Definition: dbcommands.c:1713
char * get_database_name(Oid dbid)
Definition: dbcommands.c:2980
Oid get_database_oid(const char *dbname, bool missing_ok)
Definition: dbcommands.c:2933
ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
Definition: dbcommands.c:2445
void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype)
Definition: dbcommands.c:1430
Oid createdb(ParseState *pstate, const CreatedbStmt *stmt)
Definition: dbcommands.c:670
Oid AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel)
Definition: dbcommands.c:2173
void DropDatabase(ParseState *pstate, DropdbStmt *stmt)
Definition: dbcommands.c:2148
void dropdb(const char *dbname, bool missing_ok, bool force)
Definition: dbcommands.c:1507
Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
Definition: dbcommands.c:2419
int32 encoding
Definition: pg_database.h:41
unsigned int Oid
Definition: postgres_ext.h:31
char * dbname
Definition: streamutil.c:51