60 #include "utils/fmgroids.h"
81 static void movedb(
const char *
dbname,
const char *tblspcname);
85 int *encodingP,
bool *dbIsTemplateP,
bool *dbAllowConnP,
88 Oid *dbTablespace,
char **dbCollate,
char **dbCtype);
113 Oid src_deftablespace;
114 volatile Oid dst_deftablespace;
132 char *dbowner =
NULL;
133 const char *dbtemplate =
NULL;
134 char *dbcollate =
NULL;
135 char *dbctype =
NULL;
138 bool dbistemplate =
false;
139 bool dballowconnections =
true;
140 int dbconnlimit = -1;
150 if (strcmp(defel->
defname,
"tablespace") == 0)
154 (
errcode(ERRCODE_SYNTAX_ERROR),
155 errmsg(
"conflicting or redundant options")));
156 dtablespacename = defel;
158 else if (strcmp(defel->
defname,
"owner") == 0)
162 (
errcode(ERRCODE_SYNTAX_ERROR),
163 errmsg(
"conflicting or redundant options")));
166 else if (strcmp(defel->
defname,
"template") == 0)
170 (
errcode(ERRCODE_SYNTAX_ERROR),
171 errmsg(
"conflicting or redundant options")));
174 else if (strcmp(defel->
defname,
"encoding") == 0)
178 (
errcode(ERRCODE_SYNTAX_ERROR),
179 errmsg(
"conflicting or redundant options")));
182 else if (strcmp(defel->
defname,
"lc_collate") == 0)
186 (
errcode(ERRCODE_SYNTAX_ERROR),
187 errmsg(
"conflicting or redundant options")));
190 else if (strcmp(defel->
defname,
"lc_ctype") == 0)
194 (
errcode(ERRCODE_SYNTAX_ERROR),
195 errmsg(
"conflicting or redundant options")));
198 else if (strcmp(defel->
defname,
"is_template") == 0)
202 (
errcode(ERRCODE_SYNTAX_ERROR),
203 errmsg(
"conflicting or redundant options")));
206 else if (strcmp(defel->
defname,
"allow_connections") == 0)
208 if (dallowconnections)
210 (
errcode(ERRCODE_SYNTAX_ERROR),
211 errmsg(
"conflicting or redundant options")));
212 dallowconnections = defel;
214 else if (strcmp(defel->
defname,
"connection_limit") == 0)
218 (
errcode(ERRCODE_SYNTAX_ERROR),
219 errmsg(
"conflicting or redundant options")));
222 else if (strcmp(defel->
defname,
"location") == 0)
225 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
226 errmsg(
"LOCATION is not supported anymore"),
227 errhint(
"Consider using tablespaces instead.")));
231 (
errcode(ERRCODE_SYNTAX_ERROR),
235 if (downer && downer->
arg)
237 if (dtemplate && dtemplate->
arg)
239 if (dencoding && dencoding->
arg)
241 const char *encoding_name;
243 if (
IsA(dencoding->
arg, Integer))
247 if (strcmp(encoding_name,
"") == 0 ||
250 (
errcode(ERRCODE_UNDEFINED_OBJECT),
251 errmsg(
"%d is not a valid encoding code",
260 (
errcode(ERRCODE_UNDEFINED_OBJECT),
261 errmsg(
"%s is not a valid encoding name",
265 if (dcollate && dcollate->
arg)
267 if (dctype && dctype->
arg)
269 if (distemplate && distemplate->
arg)
271 if (dallowconnections && dallowconnections->
arg)
273 if (dconnlimit && dconnlimit->
arg)
276 if (dbconnlimit < -1)
278 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
279 errmsg(
"invalid connection limit: %d", dbconnlimit)));
297 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
298 errmsg(
"permission denied to create database")));
312 dbtemplate =
"template1";
315 &src_dboid, &src_owner, &src_encoding,
316 &src_istemplate, &src_allowconn, &src_lastsysoid,
317 &src_frozenxid, &src_minmxid, &src_deftablespace,
318 &src_collate, &src_ctype))
320 (
errcode(ERRCODE_UNDEFINED_DATABASE),
321 errmsg(
"template database \"%s\" does not exist",
332 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
333 errmsg(
"permission denied to copy database \"%s\"",
339 encoding = src_encoding;
340 if (dbcollate ==
NULL)
341 dbcollate = src_collate;
348 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
349 errmsg(
"invalid server encoding %d", encoding)));
354 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
355 errmsg(
"invalid locale name: \"%s\"", dbcollate)));
356 dbcollate = canonname;
359 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
360 errmsg(
"invalid locale name: \"%s\"", dbctype)));
375 if (strcmp(dbtemplate,
"template0") != 0)
377 if (encoding != src_encoding)
379 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
380 errmsg(
"new encoding (%s) is incompatible with the encoding of the template database (%s)",
383 errhint(
"Use the same encoding as in the template database, or use template0 as template.")));
385 if (strcmp(dbcollate, src_collate) != 0)
387 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
388 errmsg(
"new collation (%s) is incompatible with the collation of the template database (%s)",
389 dbcollate, src_collate),
390 errhint(
"Use the same collation as in the template database, or use template0 as template.")));
392 if (strcmp(dbctype, src_ctype) != 0)
394 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
395 errmsg(
"new LC_CTYPE (%s) is incompatible with the LC_CTYPE of the template database (%s)",
397 errhint(
"Use the same LC_CTYPE as in the template database, or use template0 as template.")));
401 if (dtablespacename && dtablespacename->
arg)
403 char *tablespacename;
418 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
419 errmsg(
"pg_global cannot be used as default tablespace")));
433 if (dst_deftablespace != src_deftablespace)
440 if (stat(srcpath, &st) == 0 &&
441 S_ISDIR(st.st_mode) &&
444 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
445 errmsg(
"cannot assign new default tablespace \"%s\"",
447 errdetail(
"There is a conflict because database \"%s\" already has some tables in this tablespace.",
455 dst_deftablespace = src_deftablespace;
466 (
errcode(ERRCODE_DUPLICATE_DATABASE),
467 errmsg(
"database \"%s\" already exists", dbname)));
480 (
errcode(ERRCODE_OBJECT_IN_USE),
481 errmsg(
"source database \"%s\" is being accessed by other users",
504 MemSet(new_record, 0,
sizeof(new_record));
505 MemSet(new_record_nulls,
false,
sizeof(new_record_nulls));
531 new_record, new_record_nulls);
598 if (stat(srcpath, &st) < 0 || !S_ISDIR(st.st_mode) ||
606 if (srctablespace == src_deftablespace)
607 dsttablespace = dst_deftablespace;
609 dsttablespace = srctablespace;
618 copydir(srcpath, dstpath,
false);
717 if (!(ctype_encoding == encoding ||
719 ctype_encoding == -1 ||
725 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
726 errmsg(
"encoding \"%s\" does not match locale \"%s\"",
729 errdetail(
"The chosen LC_CTYPE setting requires encoding \"%s\".",
732 if (!(collate_encoding == encoding ||
734 collate_encoding == -1 ||
740 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
741 errmsg(
"encoding \"%s\" does not match locale \"%s\"",
744 errdetail(
"The chosen LC_COLLATE setting requires encoding \"%s\".",
796 (
errcode(ERRCODE_UNDEFINED_DATABASE),
797 errmsg(
"database \"%s\" does not exist", dbname)));
804 (
errmsg(
"database \"%s\" does not exist, skipping",
827 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
828 errmsg(
"cannot drop a template database")));
833 (
errcode(ERRCODE_OBJECT_IN_USE),
834 errmsg(
"cannot drop the currently open database")));
843 (
errcode(ERRCODE_OBJECT_IN_USE),
844 errmsg(
"database \"%s\" is used by a logical replication slot",
847 "There are %d slots, %d of them active.",
849 nslots, nslots_active)));
859 (
errcode(ERRCODE_OBJECT_IN_USE),
860 errmsg(
"database \"%s\" is being accessed by other users",
869 elog(
ERROR,
"cache lookup failed for database %u", db_id);
961 (
errcode(ERRCODE_UNDEFINED_DATABASE),
962 errmsg(
"database \"%s\" does not exist", oldname)));
972 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
973 errmsg(
"permission denied to rename database")));
981 (
errcode(ERRCODE_DUPLICATE_DATABASE),
982 errmsg(
"database \"%s\" already exists", newname)));
992 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
993 errmsg(
"current database cannot be renamed")));
1003 (
errcode(ERRCODE_OBJECT_IN_USE),
1004 errmsg(
"database \"%s\" is being accessed by other users",
1011 elog(
ERROR,
"cache lookup failed for database %u", db_id);
1066 (
errcode(ERRCODE_UNDEFINED_DATABASE),
1067 errmsg(
"database \"%s\" does not exist", dbname)));
1090 (
errcode(ERRCODE_OBJECT_IN_USE),
1091 errmsg(
"cannot change the tablespace of the currently open database")));
1112 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1113 errmsg(
"pg_global cannot be used as default tablespace")));
1118 if (src_tblspcoid == dst_tblspcoid)
1134 (
errcode(ERRCODE_OBJECT_IN_USE),
1135 errmsg(
"database \"%s\" is being accessed by other users",
1186 while ((xlde =
ReadDir(dstdir, dst_dbpath)) !=
NULL)
1188 if (strcmp(xlde->
d_name,
".") == 0 ||
1189 strcmp(xlde->
d_name,
"..") == 0)
1193 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1194 errmsg(
"some relations of database \"%s\" are already in tablespace \"%s\"",
1195 dbname, tblspcname),
1196 errhint(
"You must move them back to the database's default tablespace before using this command.")));
1205 if (rmdir(dst_dbpath) != 0)
1206 elog(
ERROR,
"could not remove directory \"%s\": %m",
1224 copydir(src_dbpath, dst_dbpath,
false);
1232 xlrec.
db_id = db_id;
1256 (
errcode(ERRCODE_UNDEFINED_DATABASE),
1257 errmsg(
"database \"%s\" does not exist", dbname)));
1259 MemSet(new_record, 0,
sizeof(new_record));
1260 MemSet(new_record_nulls,
false,
sizeof(new_record_nulls));
1261 MemSet(new_record_repl,
false,
sizeof(new_record_repl));
1268 new_record_nulls, new_record_repl);
1323 if (!
rmtree(src_dbpath,
true))
1325 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
1334 xlrec.
db_id = db_id;
1359 (void)
rmtree(dstpath,
true);
1376 bool dbistemplate =
false;
1377 bool dballowconnections =
true;
1378 int dbconnlimit = -1;
1388 foreach(option, stmt->
options)
1392 if (strcmp(defel->
defname,
"is_template") == 0)
1396 (
errcode(ERRCODE_SYNTAX_ERROR),
1397 errmsg(
"conflicting or redundant options")));
1398 distemplate = defel;
1400 else if (strcmp(defel->
defname,
"allow_connections") == 0)
1402 if (dallowconnections)
1404 (
errcode(ERRCODE_SYNTAX_ERROR),
1405 errmsg(
"conflicting or redundant options")));
1406 dallowconnections = defel;
1408 else if (strcmp(defel->
defname,
"connection_limit") == 0)
1412 (
errcode(ERRCODE_SYNTAX_ERROR),
1413 errmsg(
"conflicting or redundant options")));
1416 else if (strcmp(defel->
defname,
"tablespace") == 0)
1420 (
errcode(ERRCODE_SYNTAX_ERROR),
1421 errmsg(
"conflicting or redundant options")));
1422 dtablespace = defel;
1426 (
errcode(ERRCODE_SYNTAX_ERROR),
1439 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1440 errmsg(
"option \"%s\" cannot be specified with other options",
1448 if (distemplate && distemplate->
arg)
1450 if (dallowconnections && dallowconnections->
arg)
1452 if (dconnlimit && dconnlimit->
arg)
1455 if (dbconnlimit < -1)
1457 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1458 errmsg(
"invalid connection limit: %d", dbconnlimit)));
1476 (
errcode(ERRCODE_UNDEFINED_DATABASE),
1477 errmsg(
"database \"%s\" does not exist", stmt->
dbname)));
1493 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1494 errmsg(
"cannot disallow connections for current database")));
1499 MemSet(new_record, 0,
sizeof(new_record));
1500 MemSet(new_record_nulls,
false,
sizeof(new_record_nulls));
1501 MemSet(new_record_repl,
false,
sizeof(new_record_repl));
1508 if (dallowconnections)
1520 new_record_nulls, new_record_repl);
1593 (
errcode(ERRCODE_UNDEFINED_DATABASE),
1594 errmsg(
"database \"%s\" does not exist", dbname)));
1604 if (datForm->datdba != newOwnerId)
1633 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
1634 errmsg(
"permission denied to change owner of database")));
1636 memset(repl_null,
false,
sizeof(repl_null));
1637 memset(repl_repl,
false,
sizeof(repl_repl));
1653 datForm->datdba, newOwnerId);
1694 Oid *dbIdP,
Oid *ownerIdP,
1695 int *encodingP,
bool *dbIsTemplateP,
bool *dbAllowConnP,
1698 Oid *dbTablespace,
char **dbCollate,
char **dbCtype)
1700 bool result =
false;
1761 if (strcmp(name,
NameStr(dbform->datname)) == 0)
1768 *ownerIdP = dbform->datdba;
1771 *encodingP = dbform->encoding;
1774 *dbIsTemplateP = dbform->datistemplate;
1777 *dbAllowConnP = dbform->datallowconn;
1780 *dbLastSysOidP = dbform->datlastsysoid;
1783 *dbFrozenXidP = dbform->datfrozenxid;
1786 *dbMinMultiP = dbform->datminmxid;
1789 *dbTablespace = dbform->dattablespace;
1816 bool result =
false;
1859 if (
lstat(dstpath, &st) < 0 || !S_ISDIR(st.st_mode))
1866 if (!
rmtree(dstpath,
true))
1868 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
1875 xlrec.
db_id = db_id;
1907 bool result =
false;
1926 if (
lstat(dstpath, &st) == 0)
1949 if (notherbackends > 0 && npreparedxacts > 0)
1955 errdetail(
"There are %d other session(s) and %d prepared transaction(s) using the database.",
1956 notherbackends, npreparedxacts);
1957 else if (notherbackends > 0)
1959 "There are %d other sessions using the database.",
1964 "There are %d prepared transactions using the database.",
2010 (
errcode(ERRCODE_UNDEFINED_DATABASE),
2011 errmsg(
"database \"%s\" does not exist",
2067 if (stat(dst_path, &st) == 0 && S_ISDIR(st.st_mode))
2069 if (!
rmtree(dst_path,
true))
2072 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
2087 copydir(src_path, dst_path,
false);
2118 if (!
rmtree(dst_path,
true))
2120 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
2136 elog(
PANIC,
"dbase_redo: unknown op code %u", info);
#define Anum_pg_database_datdba
Oid get_tablespace_oid(const char *tablespacename, bool missing_ok)
#define IsA(nodeptr, _type_)
AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode)
Datum namein(PG_FUNCTION_ARGS)
#define CHECKPOINT_FLUSH_ALL
int errhint(const char *fmt,...)
void systable_endscan(SysScanDesc sysscan)
void heap_endscan(HeapScanDesc scan)
#define InvokeObjectPostCreateHook(classId, objectId, subId)
#define XLR_SPECIAL_REL_UPDATE
void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype)
#define Anum_pg_database_datconnlimit
Oid createdb(const CreatedbStmt *stmt)
#define Natts_pg_database
#define RelationGetDescr(relation)
FormData_pg_database * Form_pg_database
int pg_valid_server_encoding(const char *name)
#define PointerGetDatum(X)
static bool have_createdb_privilege(void)
char * pstrdup(const char *in)
#define DatabaseRelationId
void CommitTransactionCommand(void)
static void createdb_failure_callback(int code, Datum arg)
void AlterSetting(Oid databaseid, Oid roleid, VariableSetStmt *setstmt)
Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
#define InvokeObjectDropHook(classId, objectId, subId)
bool check_locale(int category, const char *locale, char **canonname)
#define GLOBALTABLESPACE_OID
void ForceSyncCommit(void)
int32 defGetInt32(DefElem *def)
int errcode(int sqlerrcode)
#define MemSet(start, val, len)
void copydir(char *fromdir, char *todir, bool recurse)
static void remove_dbtablespaces(Oid db_id)
bool directory_is_empty(const char *path)
void PopActiveSnapshot(void)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
#define DirectFunctionCall1(func, arg1)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
void heap_freetuple(HeapTuple htup)
int namestrcpy(Name name, const char *str)
static bool get_db_info(const char *name, LOCKMODE lockmode, Oid *dbIdP, Oid *ownerIdP, int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP, Oid *dbLastSysOidP, TransactionId *dbFrozenXidP, MultiXactId *dbMinMultiP, Oid *dbTablespace, char **dbCollate, char **dbCtype)
#define OidIsValid(objectId)
static void movedb_failure_callback(int code, Datum arg)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
#define SearchSysCache1(cacheId, key1)
VariableSetStmt * setstmt
void dbase_redo(XLogReaderState *record)
ObjectAddress RenameDatabase(const char *oldname, const char *newname)
void LockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
Oid get_role_oid(const char *rolname, bool missing_ok)
#define HeapTupleSetOid(tuple, oid)
FormData_pg_authid * Form_pg_authid
void changeDependencyOnOwner(Oid classId, Oid objectId, Oid newOwnerId)
#define PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg)
bool defGetBoolean(DefElem *def)
HeapTuple systable_getnext(SysScanDesc sysscan)
void pfree(void *pointer)
#define XLogRecGetData(decoder)
#define ObjectIdGetDatum(X)
void UnlockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
#define Anum_pg_database_datname
char * defGetString(DefElem *def)
static bool check_db_file_conflict(Oid db_id)
void shdepLockAndCheckObject(Oid classId, Oid objectId)
char * get_database_name(Oid dbid)
void UnlockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void FlushDatabaseBuffers(Oid dbid)
void aclcheck_error(AclResult aclerr, AclObjectKind objectkind, const char *objectname)
int errdetail(const char *fmt,...)
#define CStringGetDatum(X)
DIR * AllocateDir(const char *dirname)
HeapScanDesc heap_beginscan_catalog(Relation relation, int nkeys, ScanKey key)
#define Anum_pg_database_dattablespace
void check_is_member_of_role(Oid member, Oid role)
#define Anum_pg_database_datistemplate
#define ereport(elevel, rest)
#define InvokeObjectPostAlterHook(classId, objectId, subId)
#define AssertArg(condition)
bool pg_database_ownercheck(Oid db_oid, Oid roleid)
#define XLogRecGetInfo(decoder)
static char dstpath[MAXPGPATH]
char * GetDatabasePath(Oid dbNode, Oid spcNode)
void copyTemplateDependencies(Oid templateDbId, Oid newDbId)
#define Anum_pg_database_encoding
void pgstat_drop_database(Oid databaseid)
#define Anum_pg_database_datallowconn
#define Anum_pg_database_datacl
#define Anum_pg_database_datctype
void dropDatabaseDependencies(Oid databaseId)
#define heap_getattr(tup, attnum, tupleDesc, isnull)
bool rmtree(const char *path, bool rmtopdir)
void XLogRegisterData(char *data, int len)
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
#define TransactionIdGetDatum(X)
void ReleaseSysCache(HeapTuple tuple)
Oid simple_heap_insert(Relation relation, HeapTuple tup)
HeapTuple heap_getnext(HeapScanDesc scan, ScanDirection direction)
Oid GetNewOid(Relation relation)
Relation heap_open(Oid relationId, LOCKMODE lockmode)
void LockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void dropdb(const char *dbname, bool missing_ok)
void ForgetDatabaseFsyncRequests(Oid dbid)
Oid get_database_oid(const char *dbname, bool missing_ok)
int pg_get_encoding_from_locale(const char *ctype, bool write_message)
void ResolveRecoveryConflictWithDatabase(Oid dbid)
const char * pg_encoding_to_char(int encoding)
TransactionId MultiXactId
#define PG_VALID_BE_ENCODING(_enc)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
struct dirent * ReadDir(DIR *dir, const char *dirname)
void CatalogUpdateIndexes(Relation heapRel, HeapTuple heapTuple)
static void movedb(const char *dbname, const char *tblspcname)
void StartTransactionCommand(void)
static int list_length(const List *l)
void simple_heap_delete(Relation relation, ItemPointer tid)
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
void simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup)
ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
Oid AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel)
#define XLOG_DBASE_CREATE
#define PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg)
#define Anum_pg_database_datlastsysoid
#define DatabaseNameIndexId
#define ObjectAddressSet(addr, class_id, object_id)
bool ReplicationSlotsCountDBSlots(Oid dboid, int *nslots, int *nactive)
#define TableSpaceRelationId
#define DatumGetPointer(X)
void DeleteSharedSecurityLabel(Oid objectId, Oid classId)
#define SearchSysCacheCopy1(cacheId, key1)
#define AccessExclusiveLock
int errmsg(const char *fmt,...)
void XLogDropDatabase(Oid dbid)
#define CHECKPOINT_IMMEDIATE
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
#define Anum_pg_database_datminmxid
#define XLogRecHasAnyBlockRefs(decoder)
bool CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared)
static int errdetail_busy_db(int notherbackends, int npreparedxacts)
#define Anum_pg_database_datfrozenxid
#define HeapTupleGetOid(tuple)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *replValues, bool *replIsnull, bool *doReplace)
void DropSetting(Oid databaseid, Oid roleid)
void XLogBeginInsert(void)
void DropDatabaseBuffers(Oid dbid)
Acl * aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId)
#define BTEqualStrategyNumber
void RequestCheckpoint(int flags)
void PreventTransactionChain(bool isTopLevel, const char *stmtType)
#define Anum_pg_database_datcollate