67#include "utils/fmgroids.h"
277 rlocator.
dbOid = dbid;
296 for (blkno = 0; blkno < nblocks; blkno++)
431 elog(
ERROR,
"relation with OID %u does not have a valid relfilenumber",
441 relinfo->rlocator.dbOid = dbid;
442 relinfo->rlocator.relNumber = relfilenumber;
480 errmsg(
"could not create directory \"%s\": %m",
dbpath)));
532 xlrec.tablespace_id = tsid;
627 xlrec.src_db_id = src_dboid;
750 errmsg(
"database name \"%s\" contains a newline or carriage return character",
dbname)));
787 else if (
strcmp(
defel->defname,
"builtin_locale") == 0)
793 else if (
strcmp(
defel->defname,
"lc_collate") == 0)
805 else if (
strcmp(
defel->defname,
"icu_locale") == 0)
817 else if (
strcmp(
defel->defname,
"locale_provider") == 0)
823 else if (
strcmp(
defel->defname,
"is_template") == 0)
829 else if (
strcmp(
defel->defname,
"allow_connections") == 0)
835 else if (
strcmp(
defel->defname,
"connection_limit") == 0)
841 else if (
strcmp(
defel->defname,
"collation_version") == 0)
851 errmsg(
"LOCATION is not supported anymore"),
852 errhint(
"Consider using tablespaces instead."),
888 errmsg(
"option \"%s\" not recognized",
defel->defname),
908 errmsg(
"%d is not a valid encoding code",
919 errmsg(
"%s is not a valid encoding name",
953 errmsg(
"unrecognized locale provider: %s",
987 errmsg(
"permission denied to create database")));
1011 errmsg(
"template database \"%s\" does not exist",
1022 errhint(
"Use DROP DATABASE to drop invalid databases."));
1033 errmsg(
"permission denied to copy database \"%s\"",
1050 errmsg(
"invalid create database strategy \"%s\"", strategy),
1051 errhint(
"Valid strategies are \"wal_log\" and \"file_copy\".")));
1081 errhint(
"If the locale name is specific to the builtin provider, use BUILTIN_LOCALE.")));
1086 errhint(
"If the locale name is specific to the ICU provider, use ICU_LOCALE.")));
1099 errhint(
"If the locale name is specific to the builtin provider, use BUILTIN_LOCALE.")));
1104 errhint(
"If the locale name is specific to the ICU provider, use ICU_LOCALE.")));
1121 errmsg(
"BUILTIN_LOCALE cannot be specified unless locale provider is builtin")));
1129 errmsg(
"ICU locale cannot be specified unless locale provider is ICU")));
1134 errmsg(
"ICU rules cannot be specified unless locale provider is ICU")));
1147 errmsg(
"LOCALE or BUILTIN_LOCALE must be specified")));
1156 errmsg(
"encoding \"%s\" is not supported with ICU provider",
1166 errmsg(
"LOCALE or ICU_LOCALE must be specified")));
1181 (
errmsg(
"using standard form \"%s\" for ICU locale \"%s\"",
1210 errmsg(
"new encoding (%s) is incompatible with the encoding of the template database (%s)",
1213 errhint(
"Use the same encoding as in the template database, or use template0 as template.")));
1218 errmsg(
"new collation (%s) is incompatible with the collation of the template database (%s)",
1220 errhint(
"Use the same collation as in the template database, or use template0 as template.")));
1225 errmsg(
"new LC_CTYPE (%s) is incompatible with the LC_CTYPE of the template database (%s)",
1227 errhint(
"Use the same LC_CTYPE as in the template database, or use template0 as template.")));
1232 errmsg(
"new locale provider (%s) does not match locale provider of the template database (%s)",
1234 errhint(
"Use the same locale provider as in the template database, or use template0 as template.")));
1246 errmsg(
"new ICU locale (%s) is incompatible with the ICU locale of the template database (%s)",
1248 errhint(
"Use the same ICU locale as in the template database, or use template0 as template.")));
1259 errmsg(
"new ICU collation rules (%s) are incompatible with the ICU collation rules of the template database (%s)",
1261 errhint(
"Use the same ICU collation rules as in the template database, or use template0 as template.")));
1290 (
errmsg(
"template database \"%s\" has a collation version, but no actual collation version could be determined",
1295 (
errmsg(
"template database \"%s\" has a collation version mismatch",
1297 errdetail(
"The template database was created using collation version %s, "
1298 "but the operating system provides version %s.",
1300 errhint(
"Rebuild all objects in the template database that use the default collation and run "
1301 "ALTER DATABASE %s REFRESH COLLATION VERSION, "
1302 "or build PostgreSQL with the right library version.",
1329 char *tablespacename;
1345 errmsg(
"pg_global cannot be used as default tablespace")));
1371 errmsg(
"cannot assign new default tablespace \"%s\"",
1373 errdetail(
"There is a conflict because database \"%s\" already has some tables in this tablespace.",
1390#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
1392 elog(
WARNING,
"databases created by regression test cases should have names including \"regression\"");
1417 errmsg(
"source database \"%s\" is being accessed by other users",
1439 errmsg(
"database OID %u is already in use by database \"%s\"",
1445 errmsg(
"data directory with the specified OID %u already exists", dboid));
1541 fparms.src_dboid = src_dboid;
1542 fparms.dest_dboid = dboid;
1618 errmsg(
"encoding \"%s\" does not match locale \"%s\"",
1621 errdetail(
"The chosen LC_CTYPE setting requires encoding \"%s\".",
1633 errmsg(
"encoding \"%s\" does not match locale \"%s\"",
1636 errdetail(
"The chosen LC_COLLATE setting requires encoding \"%s\".",
1706 &
db_istemplate,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL))
1719 (
errmsg(
"database \"%s\" does not exist, skipping",
1743 errmsg(
"cannot drop a template database")));
1749 errmsg(
"cannot drop the currently open database")));
1762 errmsg(
"database \"%s\" is used by an active logical replication slot",
1765 "There are %d active slots.",
1778 errmsg(
"database \"%s\" is being used by logical replication subscription",
1781 "There are %d subscriptions.",
1801 errmsg(
"database \"%s\" is being accessed by other users",
1844 elog(
ERROR,
"cache lookup failed for database %u", db_id);
1924 errmsg(
"database name \"%s\" contains a newline or carriage return character", newname)));
1933 NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL))
1947 errmsg(
"permission denied to rename database")));
1953#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
1955 elog(
WARNING,
"databases created by regression test cases should have names including \"regression\"");
1965 errmsg(
"database \"%s\" already exists", newname)));
1976 errmsg(
"current database cannot be renamed")));
1987 errmsg(
"database \"%s\" is being accessed by other users",
1994 elog(
ERROR,
"cache lookup failed for database %u", db_id);
2045 NULL,
NULL,
NULL,
NULL, &
src_tblspcoid,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL))
2072 errmsg(
"cannot change the tablespace of the currently open database")));
2094 errmsg(
"pg_global cannot be used as default tablespace")));
2116 errmsg(
"database \"%s\" is being accessed by other users",
2178 errmsg(
"some relations of database \"%s\" are already in tablespace \"%s\"",
2180 errhint(
"You must move them back to the database's default tablespace before using this command.")));
2190 elog(
ERROR,
"could not remove directory \"%s\": %m",
2200 fparms.dest_dboid = db_id;
2222 xlrec.src_db_id = db_id;
2309 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
2319 xlrec.ntablespaces = 1;
2361 foreach(
lc,
stmt->options)
2370 errmsg(
"unrecognized %s option \"%s\"",
2371 "DROP DATABASE", opt->
defname),
2414 else if (
strcmp(
defel->defname,
"allow_connections") == 0)
2420 else if (
strcmp(
defel->defname,
"connection_limit") == 0)
2426 else if (
strcmp(
defel->defname,
"tablespace") == 0)
2435 errmsg(
"option \"%s\" not recognized",
defel->defname),
2449 errmsg(
"option \"%s\" cannot be specified with other options",
2487 errmsg(
"database \"%s\" does not exist",
stmt->dbname)));
2497 errmsg(
"cannot alter invalid database \"%s\"",
stmt->dbname),
2498 errhint(
"Use DROP DATABASE to drop invalid databases."));
2514 errmsg(
"cannot disallow connections for current database")));
2580 errmsg(
"database \"%s\" does not exist",
stmt->dbname)));
2597 elog(
ERROR,
"unexpected null in pg_database");
2603 elog(
ERROR,
"unexpected null in pg_database");
2611 elog(
ERROR,
"invalid collation version change");
2620 (
errmsg(
"changing version from %s to %s",
2633 (
errmsg(
"version has not changed")));
2744 errmsg(
"permission denied to change owner of database")));
2803 errmsg(
"database with OID %u does not exist", dbid)));
2844 bool result =
false;
2995 bool result =
false;
3027 Oid *tablespace_ids;
3053 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3089 pfree(tablespace_ids);
3110 bool result =
false;
3159 errdetail(
"There are %d other session(s) and %d prepared transaction(s) using the database.",
3163 "There are %d other sessions using the database.",
3168 "There are %d prepared transactions using the database.",
3215 errmsg(
"database \"%s\" does not exist",
3246 elog(
ERROR,
"cache lookup failed for database %u", dboid);
3277 if (
stat(path, &st) == 0)
3281 elog(
PANIC,
"requested to created invalid directory: %s", path);
3285 errmsg(
"missing directory \"%s\"", path));
3288 "creating missing directory: %s", path);
3292 errmsg(
"could not create missing directory \"%s\": %m", path));
3329 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3343 errmsg(
"could not stat directory \"%s\": %m",
3436 for (
i = 0;
i <
xlrec->ntablespaces;
i++)
3443 (
errmsg(
"some useless files may be left behind in old database directory \"%s\"",
3461 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 errmsg(const char *fmt,...)
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)