26#include "catalog/pg_database_d.h"
101 elog(
ERROR,
"unsupported object class: %u", classId);
129 msgfmt =
gettext_noop(
"text search dictionary \"%s\" already exists in schema \"%s\"");
135 msgfmt =
gettext_noop(
"text search configuration \"%s\" already exists in schema \"%s\"");
138 elog(
ERROR,
"unsupported object class: %u", classId);
182 elog(
ERROR,
"cache lookup failed for object %u of catalog \"%s\"",
208 errmsg(
"must be superuser to rename %s",
250 errmsg(
"password_required=false is superuser-only"),
251 errhint(
"Subscriptions with the password_required option set to false may only be created or modified by the superuser.")));
265 &proc->proargtypes, proc->pronamespace);
295#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
297 elog(
WARNING,
"subscriptions created by regression test cases should have names starting with \"regress_\"");
369 switch (
stmt->renameType)
451 elog(
ERROR,
"unrecognized rename stmt type: %d",
452 (
int)
stmt->renameType);
484 stmt->objectType, address,
stmt->object, rel);
534 switch (
stmt->objectType)
593 elog(
ERROR,
"unrecognized AlterObjectSchemaStmt type: %d",
594 (
int)
stmt->objectType);
706 elog(
ERROR,
"cache lookup failed for object %u of catalog \"%s\"",
740 errmsg(
"must be superuser to set schema of %s",
769 &proc->proargtypes,
nspOid);
818 elog(
ERROR,
"could not change schema dependency for object %u",
835 switch (
stmt->objectType)
901 elog(
ERROR,
"unrecognized AlterOwnerStmt type: %d",
902 (
int)
stmt->objectType);
942 elog(
ERROR,
"cache lookup failed for object %u of catalog \"%s\"",
1010 nulls =
palloc0(nattrs *
sizeof(
bool));
bool has_privs_of_role(Oid member, Oid role)
Acl * aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId)
void check_can_set_role(Oid member, Oid role)
Oid get_rolespec_oid(const RoleSpec *role, bool missing_ok)
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
static Oid AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
static void report_name_conflict(Oid classId, const char *name)
ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
static void report_namespace_conflict(Oid classId, const char *name, Oid nspOid)
ObjectAddress ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddress)
static void AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name)
ObjectAddress ExecRenameStmt(RenameStmt *stmt)
void AlterObjectOwner_internal(Oid classId, Oid objectId, Oid new_ownerId)
ObjectAddress ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt, ObjectAddress *oldSchemaAddr)
Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid, ObjectAddresses *objsMoved)
#define InvalidAttrNumber
ObjectAddress RenameTableSpace(const char *oldname, const char *newname)
void LogicalRepWorkersWakeupAtCommit(Oid subid)
static Datum values[MAXATTR]
#define Assert(condition)
#define OidIsValid(objectId)
void IsThereCollationInNamespace(const char *collname, Oid nspOid)
ObjectAddress RenameDatabase(const char *oldname, const char *newname)
ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId)
@ DEPENDENCY_AUTO_EXTENSION
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
ObjectAddress AlterEventTriggerOwner(const char *name, Oid newOwnerId)
ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *oldschema)
ObjectAddress AlterForeignServerOwner(const char *name, Oid newOwnerId)
ObjectAddress AlterForeignDataWrapperOwner(const char *name, Oid newOwnerId)
void IsThereFunctionInNamespace(const char *proname, int pronargs, oidvector *proargtypes, Oid nspOid)
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
void heap_freetuple(HeapTuple htup)
#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)
bool list_member_oid(const List *list, Oid datum)
void UnlockTuple(Relation relation, const ItemPointerData *tid, LOCKMODE lockmode)
#define AccessExclusiveLock
#define InplaceUpdateTupleLock
char * get_database_name(Oid dbid)
char * get_namespace_name(Oid nspid)
void pfree(void *pointer)
void * palloc0(Size size)
void namestrcpy(Name name, const char *str)
Oid LookupCreationNamespace(const char *nspname)
void CheckSetNamespace(Oid oldNspOid, Oid nspOid)
#define castNode(_type_, nodeptr)
#define InvokeObjectPostAlterHook(classId, objectId, subId)
int get_object_catcache_name(Oid class_id)
ObjectAddress get_object_address_rv(ObjectType objtype, RangeVar *rel, List *object, Relation *relp, LOCKMODE lockmode, bool missing_ok)
AttrNumber get_object_attnum_owner(Oid class_id)
AttrNumber get_object_attnum_oid(Oid class_id)
AttrNumber get_object_attnum_namespace(Oid class_id)
void check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address, Node *object, Relation relation)
char * getObjectDescriptionOids(Oid classid, Oid objid)
AttrNumber get_object_attnum_name(Oid class_id)
AttrNumber get_object_attnum_acl(Oid class_id)
int get_object_catcache_oid(Oid class_id)
const ObjectAddress InvalidObjectAddress
ObjectType get_object_type(Oid class_id, Oid object_id)
ObjectAddress get_object_address(ObjectType objtype, Node *object, Relation *relp, LOCKMODE lockmode, bool missing_ok)
HeapTuple get_catalog_object_by_oid_extended(Relation catalog, AttrNumber oidcol, Oid objectId, bool locktup)
#define ObjectAddressSet(addr, class_id, object_id)
void IsThereOpFamilyInNamespace(const char *opfname, Oid opfmethod, Oid opfnamespace)
void IsThereOpClassInNamespace(const char *opcname, Oid opcmethod, Oid opcnamespace)
FormData_pg_collation * Form_pg_collation
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
long changeDependencyFor(Oid classId, Oid objectId, Oid refClassId, Oid oldRefObjectId, Oid newRefObjectId)
long deleteDependencyRecordsForSpecific(Oid classId, Oid objectId, char deptype, Oid refclassId, Oid refobjectId)
List * getAutoExtensionsOfObject(Oid classId, Oid objectId)
FormData_pg_opclass * Form_pg_opclass
FormData_pg_opfamily * Form_pg_opfamily
FormData_pg_proc * Form_pg_proc
FormData_pg_publication * Form_pg_publication
void changeDependencyOnOwner(Oid classId, Oid objectId, Oid newOwnerId)
FormData_pg_subscription * Form_pg_subscription
ObjectAddress rename_policy(RenameStmt *stmt)
static Datum PointerGetDatum(const void *X)
static Name DatumGetName(Datum X)
static Oid DatumGetObjectId(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static Datum NameGetDatum(const NameData *X)
static Datum CStringGetDatum(const char *X)
void InvalidatePubRelSyncCache(Oid pubid, bool puballtables)
ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetNumberOfAttributes(relation)
#define RelationGetRelationName(relation)
#define RelationGetNamespace(relation)
ObjectAddress RenameRewriteRule(RangeVar *relation, const char *oldName, const char *newName)
ObjectAddress AlterSchemaOwner(const char *name, Oid newOwnerId)
ObjectAddress RenameSchema(const char *oldname, const char *newname)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
#define ERRCODE_DUPLICATE_OBJECT
ObjectAddress AlterSubscriptionOwner(const char *name, Oid newOwnerId)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define SearchSysCacheCopy1(cacheId, key1)
#define SearchSysCacheExists2(cacheId, key1, key2)
#define SearchSysCacheExists1(cacheId, key1)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
ObjectAddress RenameRelation(RenameStmt *stmt)
ObjectAddress renameatt(RenameStmt *stmt)
void AlterTableNamespaceInternal(Relation rel, Oid oldNspOid, Oid nspOid, ObjectAddresses *objsMoved)
ObjectAddress AlterTableNamespace(AlterObjectSchemaStmt *stmt, Oid *oldschema)
ObjectAddress RenameConstraint(RenameStmt *stmt)
ObjectAddress renametrig(RenameStmt *stmt)
Oid AlterTypeNamespace_oid(Oid typeOid, Oid nspOid, bool ignoreDependent, ObjectAddresses *objsMoved)
ObjectAddress AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype)
ObjectAddress RenameType(RenameStmt *stmt)
ObjectAddress AlterTypeNamespace(List *names, const char *newschema, ObjectType objecttype, Oid *oldschema)
ObjectAddress RenameRole(const char *oldname, const char *newname)