67#include "utils/fmgroids.h"
182 srcrelid.
dbId = src_dboid;
278 rlocator.
dbOid = dbid;
297 for (blkno = 0; blkno < nblocks; blkno++)
432 elog(
ERROR,
"relation with OID %u does not have a valid relfilenumber",
442 relinfo->rlocator.dbOid = dbid;
443 relinfo->rlocator.relNumber = relfilenumber;
481 errmsg(
"could not create directory \"%s\": %m",
dbpath)));
533 xlrec.tablespace_id = tsid;
628 xlrec.src_db_id = src_dboid;
751 errmsg(
"database name \"%s\" contains a newline or carriage return character",
dbname)));
788 else if (
strcmp(
defel->defname,
"builtin_locale") == 0)
794 else if (
strcmp(
defel->defname,
"lc_collate") == 0)
806 else if (
strcmp(
defel->defname,
"icu_locale") == 0)
818 else if (
strcmp(
defel->defname,
"locale_provider") == 0)
824 else if (
strcmp(
defel->defname,
"is_template") == 0)
830 else if (
strcmp(
defel->defname,
"allow_connections") == 0)
836 else if (
strcmp(
defel->defname,
"connection_limit") == 0)
842 else if (
strcmp(
defel->defname,
"collation_version") == 0)
852 errmsg(
"LOCATION is not supported anymore"),
853 errhint(
"Consider using tablespaces instead."),
889 errmsg(
"option \"%s\" not recognized",
defel->defname),
909 errmsg(
"%d is not a valid encoding code",
920 errmsg(
"%s is not a valid encoding name",
954 errmsg(
"unrecognized locale provider: %s",
988 errmsg(
"permission denied to create database")));
1012 errmsg(
"template database \"%s\" does not exist",
1023 errhint(
"Use DROP DATABASE to drop invalid databases."));
1034 errmsg(
"permission denied to copy database \"%s\"",
1051 errmsg(
"invalid create database strategy \"%s\"", strategy),
1052 errhint(
"Valid strategies are \"wal_log\" and \"file_copy\".")));
1082 errhint(
"If the locale name is specific to the builtin provider, use BUILTIN_LOCALE.")));
1087 errhint(
"If the locale name is specific to the ICU provider, use ICU_LOCALE.")));
1100 errhint(
"If the locale name is specific to the builtin provider, use BUILTIN_LOCALE.")));
1105 errhint(
"If the locale name is specific to the ICU provider, use ICU_LOCALE.")));
1122 errmsg(
"BUILTIN_LOCALE cannot be specified unless locale provider is builtin")));
1130 errmsg(
"ICU locale cannot be specified unless locale provider is ICU")));
1135 errmsg(
"ICU rules cannot be specified unless locale provider is ICU")));
1148 errmsg(
"LOCALE or BUILTIN_LOCALE must be specified")));
1157 errmsg(
"encoding \"%s\" is not supported with ICU provider",
1167 errmsg(
"LOCALE or ICU_LOCALE must be specified")));
1182 (
errmsg(
"using standard form \"%s\" for ICU locale \"%s\"",
1211 errmsg(
"new encoding (%s) is incompatible with the encoding of the template database (%s)",
1214 errhint(
"Use the same encoding as in the template database, or use template0 as template.")));
1219 errmsg(
"new collation (%s) is incompatible with the collation of the template database (%s)",
1221 errhint(
"Use the same collation as in the template database, or use template0 as template.")));
1226 errmsg(
"new LC_CTYPE (%s) is incompatible with the LC_CTYPE of the template database (%s)",
1228 errhint(
"Use the same LC_CTYPE as in the template database, or use template0 as template.")));
1233 errmsg(
"new locale provider (%s) does not match locale provider of the template database (%s)",
1235 errhint(
"Use the same locale provider as in the template database, or use template0 as template.")));
1247 errmsg(
"new ICU locale (%s) is incompatible with the ICU locale of the template database (%s)",
1249 errhint(
"Use the same ICU locale as in the template database, or use template0 as template.")));
1260 errmsg(
"new ICU collation rules (%s) are incompatible with the ICU collation rules of the template database (%s)",
1262 errhint(
"Use the same ICU collation rules as in the template database, or use template0 as template.")));
1291 (
errmsg(
"template database \"%s\" has a collation version, but no actual collation version could be determined",
1296 (
errmsg(
"template database \"%s\" has a collation version mismatch",
1298 errdetail(
"The template database was created using collation version %s, "
1299 "but the operating system provides version %s.",
1301 errhint(
"Rebuild all objects in the template database that use the default collation and run "
1302 "ALTER DATABASE %s REFRESH COLLATION VERSION, "
1303 "or build PostgreSQL with the right library version.",
1330 char *tablespacename;
1346 errmsg(
"pg_global cannot be used as default tablespace")));
1372 errmsg(
"cannot assign new default tablespace \"%s\"",
1374 errdetail(
"There is a conflict because database \"%s\" already has some tables in this tablespace.",
1391#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
1393 elog(
WARNING,
"databases created by regression test cases should have names including \"regression\"");
1418 errmsg(
"source database \"%s\" is being accessed by other users",
1440 errmsg(
"database OID %u is already in use by database \"%s\"",
1446 errmsg(
"data directory with the specified OID %u already exists", dboid));
1542 fparms.src_dboid = src_dboid;
1543 fparms.dest_dboid = dboid;
1619 errmsg(
"encoding \"%s\" does not match locale \"%s\"",
1622 errdetail(
"The chosen LC_CTYPE setting requires encoding \"%s\".",
1634 errmsg(
"encoding \"%s\" does not match locale \"%s\"",
1637 errdetail(
"The chosen LC_COLLATE setting requires encoding \"%s\".",
1707 &
db_istemplate,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL))
1720 (
errmsg(
"database \"%s\" does not exist, skipping",
1744 errmsg(
"cannot drop a template database")));
1750 errmsg(
"cannot drop the currently open database")));
1763 errmsg(
"database \"%s\" is used by an active logical replication slot",
1766 "There are %d active slots.",
1779 errmsg(
"database \"%s\" is being used by logical replication subscription",
1782 "There are %d subscriptions.",
1802 errmsg(
"database \"%s\" is being accessed by other users",
1845 elog(
ERROR,
"cache lookup failed for database %u", db_id);
1925 errmsg(
"database name \"%s\" contains a newline or carriage return character", newname)));
1934 NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL))
1948 errmsg(
"permission denied to rename database")));
1954#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
1956 elog(
WARNING,
"databases created by regression test cases should have names including \"regression\"");
1966 errmsg(
"database \"%s\" already exists", newname)));
1977 errmsg(
"current database cannot be renamed")));
1988 errmsg(
"database \"%s\" is being accessed by other users",
1995 elog(
ERROR,
"cache lookup failed for database %u", db_id);
2046 NULL,
NULL,
NULL,
NULL, &
src_tblspcoid,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL))
2073 errmsg(
"cannot change the tablespace of the currently open database")));
2095 errmsg(
"pg_global cannot be used as default tablespace")));
2117 errmsg(
"database \"%s\" is being accessed by other users",
2179 errmsg(
"some relations of database \"%s\" are already in tablespace \"%s\"",
2181 errhint(
"You must move them back to the database's default tablespace before using this command.")));
2191 elog(
ERROR,
"could not remove directory \"%s\": %m",
2201 fparms.dest_dboid = db_id;
2223 xlrec.src_db_id = db_id;
2310 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
2320 xlrec.ntablespaces = 1;
2362 foreach(
lc,
stmt->options)
2371 errmsg(
"unrecognized %s option \"%s\"",
2372 "DROP DATABASE", opt->
defname),
2415 else if (
strcmp(
defel->defname,
"allow_connections") == 0)
2421 else if (
strcmp(
defel->defname,
"connection_limit") == 0)
2427 else if (
strcmp(
defel->defname,
"tablespace") == 0)
2436 errmsg(
"option \"%s\" not recognized",
defel->defname),
2450 errmsg(
"option \"%s\" cannot be specified with other options",
2488 errmsg(
"database \"%s\" does not exist",
stmt->dbname)));
2498 errmsg(
"cannot alter invalid database \"%s\"",
stmt->dbname),
2499 errhint(
"Use DROP DATABASE to drop invalid databases."));
2515 errmsg(
"cannot disallow connections for current database")));
2581 errmsg(
"database \"%s\" does not exist",
stmt->dbname)));
2598 elog(
ERROR,
"unexpected null in pg_database");
2604 elog(
ERROR,
"unexpected null in pg_database");
2612 elog(
ERROR,
"invalid collation version change");
2621 (
errmsg(
"changing version from %s to %s",
2634 (
errmsg(
"version has not changed")));
2745 errmsg(
"permission denied to change owner of database")));
2804 errmsg(
"database with OID %u does not exist", dbid)));
2845 bool result =
false;
2996 bool result =
false;
3028 Oid *tablespace_ids;
3054 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3090 pfree(tablespace_ids);
3111 bool result =
false;
3160 errdetail(
"There are %d other session(s) and %d prepared transaction(s) using the database.",
3164 "There are %d other sessions using the database.",
3169 "There are %d prepared transactions using the database.",
3216 errmsg(
"database \"%s\" does not exist",
3247 elog(
ERROR,
"cache lookup failed for database %u", dboid);
3278 if (
stat(path, &st) == 0)
3282 elog(
PANIC,
"requested to created invalid directory: %s", path);
3286 errmsg(
"missing directory \"%s\"", path));
3289 "creating missing directory: %s", path);
3293 errmsg(
"could not create missing directory \"%s\": %m", path));
3330 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3344 errmsg(
"could not stat directory \"%s\": %m",
3437 for (
i = 0;
i <
xlrec->ntablespaces;
i++)
3444 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3462 elog(
PANIC,
"dbase_redo: unknown op code %u", info);
Acl * aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId)
Oid get_role_oid(const char *rolname, bool missing_ok)
void check_can_set_role(Oid member, Oid role)
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
bool directory_is_empty(const char *path)
Oid get_tablespace_oid(const char *tablespacename, bool missing_ok)
bool allow_in_place_tablespaces
static Datum values[MAXATTR]
void DropDatabaseBuffers(Oid dbid)
BlockNumber BufferGetBlockNumber(Buffer buffer)
void CreateAndCopyRelationData(RelFileLocator src_rlocator, RelFileLocator dst_rlocator, bool permanent)
void UnlockReleaseBuffer(Buffer buffer)
Buffer ReadBufferWithoutRelcache(RelFileLocator rlocator, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, bool permanent)
void FlushDatabaseBuffers(Oid dbid)
static Page BufferGetPage(Buffer buffer)
static void LockBuffer(Buffer buffer, BufferLockMode mode)
static bool PageIsEmpty(const PageData *page)
static bool PageIsNew(const PageData *page)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static void * PageGetItem(PageData *page, const ItemIdData *itemId)
static OffsetNumber PageGetMaxOffsetNumber(const PageData *page)
#define CStringGetTextDatum(s)
#define TextDatumGetCString(d)
#define Assert(condition)
TransactionId MultiXactId
#define OidIsValid(objectId)
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
void RequestCheckpoint(int flags)
void copydir(const char *fromdir, const char *todir, bool recurse)
static void remove_dbtablespaces(Oid db_id)
static void CreateDirAndVersionFile(char *dbpath, Oid dbid, Oid tsid, bool isRedo)
ObjectAddress AlterDatabaseRefreshColl(AlterDatabaseRefreshCollStmt *stmt)
bool have_createdb_privilege(void)
ObjectAddress RenameDatabase(const char *oldname, const char *newname)
Oid get_database_oid(const char *dbname, bool missing_ok)
static void movedb_failure_callback(int code, Datum arg)
static void CreateDatabaseUsingWalLog(Oid src_dboid, Oid dst_dboid, Oid src_tsid, Oid dst_tsid)
static List * ScanSourceDatabasePgClass(Oid tbid, Oid dbid, char *srcpath)
static void recovery_create_dbdir(char *path, bool only_tblspc)
ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
bool database_is_invalid_form(Form_pg_database datform)
Datum pg_database_collation_actual_version(PG_FUNCTION_ARGS)
static void movedb(const char *dbname, const char *tblspcname)
static List * ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid, Oid dbid, char *srcpath, List *rlocatorlist, Snapshot snapshot)
void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype)
Oid createdb(ParseState *pstate, const CreatedbStmt *stmt)
Oid AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel)
static int errdetail_busy_db(int notherbackends, int npreparedxacts)
static CreateDBRelInfo * ScanSourceDatabasePgClassTuple(HeapTupleData *tuple, Oid tbid, Oid dbid, char *srcpath)
static bool check_db_file_conflict(Oid db_id)
void dbase_redo(XLogReaderState *record)
static void CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid, Oid src_tsid, Oid dst_tsid)
void DropDatabase(ParseState *pstate, DropdbStmt *stmt)
void dropdb(const char *dbname, bool missing_ok, bool force)
Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
static bool get_db_info(const char *name, LOCKMODE lockmode, Oid *dbIdP, Oid *ownerIdP, int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP, bool *dbHasLoginEvtP, TransactionId *dbFrozenXidP, MultiXactId *dbMinMultiP, Oid *dbTablespace, char **dbCollate, char **dbCtype, char **dbLocale, char **dbIcurules, char *dbLocProvider, char **dbCollversion)
static void createdb_failure_callback(int code, Datum arg)
bool database_is_invalid_oid(Oid dboid)
#define XLOG_DBASE_CREATE_WAL_LOG
#define MinSizeOfDbaseDropRec
#define XLOG_DBASE_CREATE_FILE_COPY
int32 defGetInt32(DefElem *def)
char * defGetString(DefElem *def)
bool defGetBoolean(DefElem *def)
void errorConflictingDefElem(DefElem *defel, ParseState *pstate)
Oid defGetObjectId(DefElem *def)
int errcode_for_file_access(void)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
bool is_encoding_supported_by_icu(int encoding)
int MakePGDirectory(const char *directoryName)
int CloseTransientFile(int fd)
void fsync_fname(const char *fname, bool isdir)
int data_sync_elevel(int elevel)
DIR * AllocateDir(const char *dirname)
struct dirent * ReadDir(DIR *dir, const char *dirname)
int OpenTransientFile(const char *fileName, int fileFlags)
#define palloc_object(type)
static char dstpath[MAXPGPATH]
#define DirectFunctionCall1(func, arg1)
#define PG_RETURN_TEXT_P(x)
BufferAccessStrategy GetAccessStrategy(BufferAccessStrategyType btype)
void systable_endscan(SysScanDesc sysscan)
void systable_inplace_update_begin(Relation relation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, const ScanKeyData *key, HeapTuple *oldtupcopy, void **state)
void systable_inplace_update_finish(void *state, HeapTuple tuple)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
bool allowSystemTableMods
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
bool HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot, Buffer buffer)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_freetuple(HeapTuple htup)
HeapTupleHeaderData * HeapTupleHeader
#define HeapTupleIsValid(tuple)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
static void * GETSTRUCT(const HeapTupleData *tuple)
void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
void CatalogTupleDelete(Relation heapRel, const ItemPointerData *tid)
#define PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg)
#define PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg)
invalidindex index d is invalid
#define ItemIdGetLength(itemId)
#define ItemIdIsNormal(itemId)
#define ItemIdIsDead(itemId)
#define ItemIdIsUsed(itemId)
#define ItemIdIsRedirected(itemId)
static void ItemPointerSet(ItemPointerData *pointer, BlockNumber blockNumber, OffsetNumber offNum)
List * lappend(List *list, void *datum)
List * lappend_oid(List *list, Oid datum)
void list_free(List *list)
void list_free_deep(List *list)
void UnlockTuple(Relation relation, const ItemPointerData *tid, LOCKMODE lockmode)
void LockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void UnlockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void UnlockRelationId(LockRelId *relid, LOCKMODE lockmode)
void LockTuple(Relation relation, const ItemPointerData *tid, LOCKMODE lockmode)
void UnlockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void LockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void LockRelationId(LockRelId *relid, LOCKMODE lockmode)
#define AccessExclusiveLock
#define InplaceUpdateTupleLock
char * get_database_name(Oid dbid)
char * pstrdup(const char *in)
void pfree(void *pointer)
void ForgetDatabaseSyncRequests(Oid dbid)
#define START_CRIT_SECTION()
#define CHECK_FOR_INTERRUPTS()
#define END_CRIT_SECTION()
#define InvalidMultiXactId
void namestrcpy(Name name, const char *str)
Datum namein(PG_FUNCTION_ARGS)
#define IsA(nodeptr, _type_)
#define InvokeObjectPostCreateHook(classId, objectId, subId)
#define InvokeObjectPostAlterHook(classId, objectId, subId)
#define InvokeObjectDropHook(classId, objectId, subId)
#define ObjectAddressSet(addr, class_id, object_id)
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
int parser_errposition(ParseState *pstate, int location)
END_CATALOG_STRUCT typedef FormData_pg_authid * Form_pg_authid
FormData_pg_class * Form_pg_class
#define DATCONNLIMIT_INVALID_DB
END_CATALOG_STRUCT typedef FormData_pg_database * Form_pg_database
#define DATCONNLIMIT_UNLIMITED
void DropSetting(Oid databaseid, Oid roleid)
void AlterSetting(Oid databaseid, Oid roleid, VariableSetStmt *setstmt)
static int list_length(const List *l)
void icu_validate_locale(const char *loc_str)
char * get_collation_actual_version(char collprovider, const char *collcollate)
char * icu_language_tag(const char *loc_str, int elevel)
const char * builtin_validate_locale(int encoding, const char *locale)
bool check_locale(int category, const char *locale, char **canonname)
void dropDatabaseDependencies(Oid databaseId)
void changeDependencyOnOwner(Oid classId, Oid objectId, Oid newOwnerId)
void copyTemplateDependencies(Oid templateDbId, Oid newDbId)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
void shdepLockAndCheckObject(Oid classId, Oid objectId)
int CountDBSubscriptions(Oid dbid)
END_CATALOG_STRUCT typedef FormData_pg_tablespace * Form_pg_tablespace
static char buf[DEFAULT_XLOG_SEG_SIZE]
#define PG_VALID_BE_ENCODING(_enc)
#define pg_encoding_to_char
#define pg_valid_server_encoding
void pgstat_drop_database(Oid databaseid)
int pg_mkdir_p(char *path, int omode)
int pg_strcasecmp(const char *s1, const char *s2)
void get_parent_directory(char *path)
int pg_get_encoding_from_locale(const char *ctype, bool write_message)
static Datum PointerGetDatum(const void *X)
static Datum TransactionIdGetDatum(TransactionId X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
static Datum CharGetDatum(char X)
static int fd(const char *x, int i)
void TerminateOtherDBBackends(Oid databaseId)
bool CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared)
#define INVALID_PROC_NUMBER
void WaitForProcSignalBarrier(uint64 generation)
uint64 EmitProcSignalBarrier(ProcSignalBarrierType type)
@ PROCSIGNAL_BARRIER_SMGRRELEASE
#define RelationGetDescr(relation)
RelFileNumber RelationMapOidToFilenumberForDatabase(char *dbpath, Oid relationId)
void RelationMapCopy(Oid dbid, Oid tsid, char *srcdbpath, char *dstdbpath)
char * GetDatabasePath(Oid dbOid, Oid spcOid)
#define PG_TBLSPC_DIR_SLASH
#define InvalidRelFileNumber
#define RelFileNumberIsValid(relnumber)
bool rmtree(const char *path, bool rmtopdir)
const char * quote_identifier(const char *ident)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
void DeleteSharedSecurityLabel(Oid objectId, Oid classId)
bool ReplicationSlotsCountDBSlots(Oid dboid, int *nslots, int *nactive)
void ReplicationSlotsDropDBSlots(Oid dboid)
BlockNumber smgrnblocks(SMgrRelation reln, ForkNumber forknum)
SMgrRelation smgropen(RelFileLocator rlocator, ProcNumber backend)
void smgrclose(SMgrRelation reln)
Snapshot GetLatestSnapshot(void)
void UnregisterSnapshot(Snapshot snapshot)
Snapshot RegisterSnapshot(Snapshot snapshot)
void PopActiveSnapshot(void)
void ResolveRecoveryConflictWithDatabase(Oid dbid)
#define BTEqualStrategyNumber
CreateDBStrategy strategy
HeapTuple SearchSysCacheLockedCopy1(SysCacheIdentifier cacheId, Datum key1)
void ReleaseSysCache(HeapTuple tuple)
Datum SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
#define InvalidTransactionId
#define FirstNormalObjectId
text * cstring_to_text(const char *s)
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
void StartTransactionCommand(void)
void ForceSyncCommit(void)
void CommitTransactionCommand(void)
bool RecoveryInProgress(void)
XLogRecPtr XactLastRecEnd
void XLogFlush(XLogRecPtr record)
#define CHECKPOINT_FLUSH_UNLOGGED
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterData(const void *data, uint32 len)
void XLogBeginInsert(void)
#define XLogRecGetInfo(decoder)
#define XLogRecGetData(decoder)
#define XLogRecHasAnyBlockRefs(decoder)
#define XLR_SPECIAL_REL_UPDATE
void XLogDropDatabase(Oid dbid)