PostgreSQL Source Code  git master
dbcommands.h
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-2024, 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
16 
17 #include "access/xlogreader.h"
18 #include "catalog/objectaddress.h"
19 #include "lib/stringinfo.h"
20 #include "parser/parse_node.h"
21 
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);
30 
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);
34 
35 extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype);
36 
37 #endif /* DBCOMMANDS_H */
ObjectAddress AlterDatabaseRefreshColl(AlterDatabaseRefreshCollStmt *stmt)
Definition: dbcommands.c:2514
bool have_createdb_privilege(void)
Definition: dbcommands.c:2952
ObjectAddress RenameDatabase(const char *oldname, const char *newname)
Definition: dbcommands.c:1876
char * get_database_name(Oid dbid)
Definition: dbcommands.c:3187
Oid get_database_oid(const char *dbname, bool missing_ok)
Definition: dbcommands.c:3140
ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
Definition: dbcommands.c:2637
void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype)
Definition: dbcommands.c:1570
Oid createdb(ParseState *pstate, const CreatedbStmt *stmt)
Definition: dbcommands.c:683
Oid AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel)
Definition: dbcommands.c:2341
void DropDatabase(ParseState *pstate, DropdbStmt *stmt)
Definition: dbcommands.c:2316
void dropdb(const char *dbname, bool missing_ok, bool force)
Definition: dbcommands.c:1647
Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
Definition: dbcommands.c:2611
#define stmt
Definition: indent_codes.h:59
int32 encoding
Definition: pg_database.h:41
unsigned int Oid
Definition: postgres_ext.h:31
char * dbname
Definition: streamutil.c:52