PostgreSQL Source Code
git master
|
#include "catalog/objectaddress.h"
Go to the source code of this file.
Macros | |
#define | PERFORM_DELETION_INTERNAL 0x0001 /* internal action */ |
#define | PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */ |
#define | PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */ |
#define | PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */ |
#define | PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */ |
#define | PERFORM_DELETION_CONCURRENT_LOCK |
Typedefs | |
typedef enum DependencyType | DependencyType |
typedef enum SharedDependencyType | SharedDependencyType |
typedef struct ObjectAddresses | ObjectAddresses |
Enumerations | |
enum | DependencyType { DEPENDENCY_NORMAL = 'n' , DEPENDENCY_AUTO = 'a' , DEPENDENCY_INTERNAL = 'i' , DEPENDENCY_PARTITION_PRI = 'P' , DEPENDENCY_PARTITION_SEC = 'S' , DEPENDENCY_EXTENSION = 'e' , DEPENDENCY_AUTO_EXTENSION = 'x' } |
enum | SharedDependencyType { SHARED_DEPENDENCY_OWNER = 'o' , SHARED_DEPENDENCY_ACL = 'a' , SHARED_DEPENDENCY_INITACL = 'i' , SHARED_DEPENDENCY_POLICY = 'r' , SHARED_DEPENDENCY_TABLESPACE = 't' , SHARED_DEPENDENCY_INVALID = 0 } |
Functions | |
void | AcquireDeletionLock (const ObjectAddress *object, int flags) |
void | ReleaseDeletionLock (const ObjectAddress *object) |
void | performDeletion (const ObjectAddress *object, DropBehavior behavior, int flags) |
void | performMultipleDeletions (const ObjectAddresses *objects, DropBehavior behavior, int flags) |
void | recordDependencyOnExpr (const ObjectAddress *depender, Node *expr, List *rtable, DependencyType behavior) |
void | recordDependencyOnSingleRelExpr (const ObjectAddress *depender, Node *expr, Oid relId, DependencyType behavior, DependencyType self_behavior, bool reverse_self) |
ObjectAddresses * | new_object_addresses (void) |
void | add_exact_object_address (const ObjectAddress *object, ObjectAddresses *addrs) |
bool | object_address_present (const ObjectAddress *object, const ObjectAddresses *addrs) |
void | record_object_address_dependencies (const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior) |
void | sort_object_addresses (ObjectAddresses *addrs) |
void | free_object_addresses (ObjectAddresses *addrs) |
void | recordDependencyOn (const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior) |
void | recordMultipleDependencies (const ObjectAddress *depender, const ObjectAddress *referenced, int nreferenced, DependencyType behavior) |
void | recordDependencyOnCurrentExtension (const ObjectAddress *object, bool isReplace) |
void | checkMembershipInCurrentExtension (const ObjectAddress *object) |
long | deleteDependencyRecordsFor (Oid classId, Oid objectId, bool skipExtensionDeps) |
long | deleteDependencyRecordsForClass (Oid classId, Oid objectId, Oid refclassId, char deptype) |
long | deleteDependencyRecordsForSpecific (Oid classId, Oid objectId, char deptype, Oid refclassId, Oid refobjectId) |
long | changeDependencyFor (Oid classId, Oid objectId, Oid refClassId, Oid oldRefObjectId, Oid newRefObjectId) |
long | changeDependenciesOf (Oid classId, Oid oldObjectId, Oid newObjectId) |
long | changeDependenciesOn (Oid refClassId, Oid oldRefObjectId, Oid newRefObjectId) |
Oid | getExtensionOfObject (Oid classId, Oid objectId) |
List * | getAutoExtensionsOfObject (Oid classId, Oid objectId) |
bool | sequenceIsOwned (Oid seqId, char deptype, Oid *tableId, int32 *colId) |
List * | getOwnedSequences (Oid relid) |
Oid | getIdentitySequence (Relation rel, AttrNumber attnum, bool missing_ok) |
Oid | get_index_constraint (Oid indexId) |
List * | get_index_ref_constraints (Oid indexId) |
void | recordSharedDependencyOn (ObjectAddress *depender, ObjectAddress *referenced, SharedDependencyType deptype) |
void | deleteSharedDependencyRecordsFor (Oid classId, Oid objectId, int32 objectSubId) |
void | recordDependencyOnOwner (Oid classId, Oid objectId, Oid owner) |
void | changeDependencyOnOwner (Oid classId, Oid objectId, Oid newOwnerId) |
void | recordDependencyOnTablespace (Oid classId, Oid objectId, Oid tablespace) |
void | changeDependencyOnTablespace (Oid classId, Oid objectId, Oid newTablespaceId) |
void | updateAclDependencies (Oid classId, Oid objectId, int32 objsubId, Oid ownerId, int noldmembers, Oid *oldmembers, int nnewmembers, Oid *newmembers) |
void | updateInitAclDependencies (Oid classId, Oid objectId, int32 objsubId, int noldmembers, Oid *oldmembers, int nnewmembers, Oid *newmembers) |
bool | checkSharedDependencies (Oid classId, Oid objectId, char **detail_msg, char **detail_log_msg) |
void | shdepLockAndCheckObject (Oid classId, Oid objectId) |
void | copyTemplateDependencies (Oid templateDbId, Oid newDbId) |
void | dropDatabaseDependencies (Oid databaseId) |
void | shdepDropOwned (List *roleids, DropBehavior behavior) |
void | shdepReassignOwned (List *roleids, Oid newrole) |
#define PERFORM_DELETION_CONCURRENT_LOCK |
Definition at line 97 of file dependency.h.
#define PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */ |
Definition at line 93 of file dependency.h.
#define PERFORM_DELETION_INTERNAL 0x0001 /* internal action */ |
Definition at line 92 of file dependency.h.
#define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */ |
Definition at line 94 of file dependency.h.
#define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */ |
Definition at line 96 of file dependency.h.
#define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */ |
Definition at line 95 of file dependency.h.
typedef enum DependencyType DependencyType |
typedef struct ObjectAddresses ObjectAddresses |
Definition at line 1 of file dependency.h.
typedef enum SharedDependencyType SharedDependencyType |
enum DependencyType |
Enumerator | |
---|---|
DEPENDENCY_NORMAL | |
DEPENDENCY_AUTO | |
DEPENDENCY_INTERNAL | |
DEPENDENCY_PARTITION_PRI | |
DEPENDENCY_PARTITION_SEC | |
DEPENDENCY_EXTENSION | |
DEPENDENCY_AUTO_EXTENSION |
Definition at line 31 of file dependency.h.
enum SharedDependencyType |
Enumerator | |
---|---|
SHARED_DEPENDENCY_OWNER | |
SHARED_DEPENDENCY_ACL | |
SHARED_DEPENDENCY_INITACL | |
SHARED_DEPENDENCY_POLICY | |
SHARED_DEPENDENCY_TABLESPACE | |
SHARED_DEPENDENCY_INVALID |
Definition at line 78 of file dependency.h.
void AcquireDeletionLock | ( | const ObjectAddress * | object, |
int | flags | ||
) |
Definition at line 1496 of file dependency.c.
References AccessExclusiveLock, ObjectAddress::classId, ObjectAddressStack::flags, LockDatabaseObject(), LockRelationOid(), LockSharedObject(), ObjectAddressStack::object, ObjectAddress::objectId, PERFORM_DELETION_CONCURRENTLY, and ShareUpdateExclusiveLock.
Referenced by findDependentObjects(), performDeletion(), performMultipleDeletions(), and shdepDropOwned().
void add_exact_object_address | ( | const ObjectAddress * | object, |
ObjectAddresses * | addrs | ||
) |
Definition at line 2533 of file dependency.c.
References Assert, ObjectAddresses::extras, ObjectAddresses::maxrefs, ObjectAddresses::numrefs, ObjectAddressStack::object, ObjectAddresses::refs, and repalloc().
Referenced by AggregateCreate(), AlterConstraintNamespaces(), AlterIndexNamespaces(), AlterRelationNamespaceInternal(), AlterTypeNamespaceInternal(), ATExecDropColumn(), ATPostAlterTypeCleanup(), CastCreate(), CreateConstraintEntry(), CreateProceduralLanguage(), CreateTransform(), DropClonedTriggersFromPartition(), GenerateTypeDependencies(), heap_create_with_catalog(), index_create(), InsertExtensionTuple(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), makeParserDependencies(), makeTSTemplateDependencies(), PreCommit_on_commit_actions(), ProcedureCreate(), RangeCreate(), recordDependencyOnSingleRelExpr(), ReindexRelationConcurrently(), RemoveObjects(), RemoveRelations(), shdepDropOwned(), and StorePartitionKey().
Definition at line 566 of file pg_depend.c.
References BTEqualStrategyNumber, CatalogTupleUpdate(), GETSTRUCT, heap_copytuple(), heap_freetuple(), HeapTupleIsValid, sort-test::key, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by index_concurrently_swap().
Definition at line 622 of file pg_depend.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), CatalogTupleUpdate(), ObjectAddress::classId, ereport, errcode(), errmsg(), ERROR, getObjectDescription(), GETSTRUCT, heap_copytuple(), heap_freetuple(), HeapTupleIsValid, isObjectPinned(), sort-test::key, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by index_concurrently_swap().
long changeDependencyFor | ( | Oid | classId, |
Oid | objectId, | ||
Oid | refClassId, | ||
Oid | oldRefObjectId, | ||
Oid | newRefObjectId | ||
) |
Definition at line 458 of file pg_depend.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), CatalogTupleUpdate(), ObjectAddress::classId, DEPENDENCY_NORMAL, GETSTRUCT, heap_copytuple(), heap_freetuple(), HeapTupleIsValid, isObjectPinned(), sort-test::key, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, recordDependencyOn(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by AlterExtensionNamespace(), AlterFunction(), AlterObjectNamespace_internal(), AlterRelationNamespaceInternal(), AlterTypeNamespaceInternal(), ATExecSetAccessMethodNoStorage(), and swap_relation_files().
Definition at line 316 of file pg_shdepend.c.
References RowExclusiveLock, SHARED_DEPENDENCY_ACL, SHARED_DEPENDENCY_OWNER, shdepChangeDep(), shdepDropDependency(), table_close(), and table_open().
Referenced by AlterDatabaseOwner(), AlterEventTriggerOwner_internal(), AlterForeignDataWrapperOwner_internal(), AlterForeignServerOwner_internal(), AlterObjectOwner_internal(), AlterPublicationOwner_internal(), AlterSchemaOwner_internal(), AlterSubscriptionOwner_internal(), AlterTypeOwner_oid(), and ATExecChangeOwner().
Definition at line 391 of file pg_shdepend.c.
References InvalidOid, RowExclusiveLock, SHARED_DEPENDENCY_INVALID, SHARED_DEPENDENCY_TABLESPACE, shdepChangeDep(), shdepDropDependency(), table_close(), and table_open().
Referenced by SetRelationTableSpace().
void checkMembershipInCurrentExtension | ( | const ObjectAddress * | object | ) |
Definition at line 259 of file pg_depend.c.
References Assert, ObjectAddress::classId, creating_extension, CurrentExtensionObject, ereport, errcode(), errdetail(), errmsg(), ERROR, get_extension_name(), getExtensionOfObject(), getObjectDescription(), ObjectAddress::objectId, and ObjectAddress::objectSubId.
Referenced by CollationCreate(), CreateForeignServer(), CreateSchemaCommand(), CreateTableAsRelExists(), DefineSequence(), and transformCreateStmt().
bool checkSharedDependencies | ( | Oid | classId, |
Oid | objectId, | ||
char ** | detail_msg, | ||
char ** | detail_log_msg | ||
) |
Definition at line 676 of file pg_shdepend.c.
References AccessShareLock, appendStringInfo(), BTEqualStrategyNumber, remoteDep::count, StringInfoData::data, remoteDep::dbOid, ShDependObjectInfo::deptype, ereport, errcode(), errmsg(), ERROR, getObjectDescription(), GETSTRUCT, HeapTupleIsValid, i, initStringInfo(), InvalidOid, IsPinnedObject(), sort-test::key, lappend(), StringInfoData::len, lfirst, list_free_deep(), LOCAL_OBJECT, MAX_REPORTED_DEPS, MyDatabaseId, ngettext, NIL, ShDependObjectInfo::object, ObjectIdGetDatum(), ShDependObjectInfo::objtype, palloc(), pfree(), qsort, REMOTE_OBJECT, repalloc(), ScanKeyInit(), shared_dependency_comparator(), SHARED_DEPENDENCY_INVALID, SHARED_OBJECT, storeObjectDescription(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by DropRole(), and DropTableSpace().
Definition at line 895 of file pg_shdepend.c.
References BTEqualStrategyNumber, CatalogCloseIndexes(), CatalogOpenIndexes(), CatalogTuplesMultiInsertWithInfo(), ExecClearTuple(), ExecDropSingleTupleTableSlot(), ExecStoreVirtualTuple(), FormData_pg_shdepend, GETSTRUCT, HeapTupleIsValid, i, sort-test::key, MakeSingleTupleTableSlot(), MAX_CATALOG_MULTI_INSERT_BYTES, ObjectIdGetDatum(), palloc(), pfree(), RelationGetDescr, RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), TupleTableSlot::tts_values, and TTSOpsHeapTuple.
Referenced by createdb().
Definition at line 302 of file pg_depend.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), DEPENDENCY_EXTENSION, GETSTRUCT, HeapTupleIsValid, sort-test::key, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by AlterPolicy(), ATExecAlterColumnType(), ATExecDropExpression(), ATExecSetExpression(), CreateProceduralLanguage(), CreateTransform(), CreateTriggerFiringOn(), GenerateTypeDependencies(), InsertRule(), makeConfigurationDependencies(), makeOperatorDependencies(), ProcedureCreate(), swap_relation_files(), and tryAttachPartitionForeignKey().
Definition at line 352 of file pg_depend.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), GETSTRUCT, HeapTupleIsValid, sort-test::key, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by AlterForeignDataWrapper(), ApplyExtensionUpdates(), ATExecDropIdentity(), ATExecSetAccessMethodNoStorage(), ConstraintSetParentConstraint(), DetachPartitionFinalize(), DropClonedTriggersFromPartition(), ExecAlterExtensionContentsRecurse(), index_constraint_create(), IndexSetParentIndex(), process_owned_by(), and TriggerSetParentTrigger().
long deleteDependencyRecordsForSpecific | ( | Oid | classId, |
Oid | objectId, | ||
char | deptype, | ||
Oid | refclassId, | ||
Oid | refobjectId | ||
) |
Definition at line 399 of file pg_depend.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), GETSTRUCT, HeapTupleIsValid, sort-test::key, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by ExecAlterObjectDependsStmt().
Definition at line 1047 of file pg_shdepend.c.
References InvalidOid, RowExclusiveLock, SHARED_DEPENDENCY_INVALID, shdepDropDependency(), table_close(), and table_open().
Referenced by AlterPolicy(), deleteOneObject(), DelRoleMems(), DropRole(), DropSubscription(), DropTableSpace(), GenerateTypeDependencies(), makeConfigurationDependencies(), makeOperatorDependencies(), and RemoveRoleFromObjectPolicy().
void dropDatabaseDependencies | ( | Oid | databaseId | ) |
Definition at line 999 of file pg_shdepend.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), HeapTupleIsValid, InvalidOid, sort-test::key, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), SHARED_DEPENDENCY_INVALID, shdepDropDependency(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by dropdb().
void free_object_addresses | ( | ObjectAddresses * | addrs | ) |
Definition at line 2773 of file dependency.c.
References ObjectAddresses::extras, pfree(), and ObjectAddresses::refs.
Referenced by AggregateCreate(), AlterTableNamespace(), AlterTypeNamespace(), ATExecDropColumn(), CastCreate(), CreateConstraintEntry(), CreateProceduralLanguage(), CreateTransform(), DropClonedTriggersFromPartition(), GenerateTypeDependencies(), heap_create_with_catalog(), index_create(), InsertExtensionTuple(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), makeParserDependencies(), makeTSTemplateDependencies(), performDeletion(), performMultipleDeletions(), ProcedureCreate(), RangeCreate(), recordDependencyOnExpr(), recordDependencyOnSingleRelExpr(), RemoveObjects(), RemoveRelations(), shdepDropOwned(), and StorePartitionKey().
Definition at line 989 of file pg_depend.c.
References AccessShareLock, BTEqualStrategyNumber, DEPENDENCY_INTERNAL, GETSTRUCT, HeapTupleIsValid, Int32GetDatum(), InvalidOid, sort-test::key, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by generateClonedIndexStmt(), index_concurrently_swap(), RememberIndexForRebuilding(), RenameRelationInternal(), and transformIndexConstraint().
Definition at line 1045 of file pg_depend.c.
References AccessShareLock, BTEqualStrategyNumber, DEPENDENCY_NORMAL, GETSTRUCT, HeapTupleIsValid, Int32GetDatum(), sort-test::key, lappend_oid(), NIL, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by index_concurrently_swap().
Definition at line 779 of file pg_depend.c.
References AccessShareLock, BTEqualStrategyNumber, DEPENDENCY_AUTO_EXTENSION, GETSTRUCT, HeapTupleIsValid, sort-test::key, lappend_oid(), NIL, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ExecAlterObjectDependsStmt().
Definition at line 733 of file pg_depend.c.
References AccessShareLock, BTEqualStrategyNumber, DEPENDENCY_EXTENSION, GETSTRUCT, HeapTupleIsValid, InvalidOid, sort-test::key, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterExtensionNamespace(), checkMembershipInCurrentExtension(), ExecAlterExtensionContentsRecurse(), lookup_shippable(), pg_extension_config_dump(), and recordDependencyOnCurrentExtension().
Oid getIdentitySequence | ( | Relation | rel, |
AttrNumber | attnum, | ||
bool | missing_ok | ||
) |
Definition at line 946 of file pg_depend.c.
References attname, attnum, DEPENDENCY_INTERNAL, elog, ERROR, get_attname(), get_attnum(), get_partition_ancestors(), getOwnedSequences_internal(), InvalidAttrNumber, InvalidOid, linitial_oid, list_free(), list_length(), llast_oid, NIL, RelationGetForm, and RelationGetRelid.
Referenced by ATExecDropIdentity(), build_column_default(), transformAlterTableStmt(), and transformTableLikeClause().
Definition at line 937 of file pg_depend.c.
References getOwnedSequences_internal().
Referenced by ATRewriteTables(), and ExecuteTruncateGuts().
ObjectAddresses* new_object_addresses | ( | void | ) |
Definition at line 2487 of file dependency.c.
References ObjectAddresses::extras, ObjectAddresses::maxrefs, ObjectAddresses::numrefs, palloc(), and ObjectAddresses::refs.
Referenced by AggregateCreate(), AlterExtensionNamespace(), AlterTableNamespace(), AlterTypeNamespace(), ATExecDropColumn(), ATPostAlterTypeCleanup(), CastCreate(), CreateConstraintEntry(), CreateProceduralLanguage(), CreateTransform(), DropClonedTriggersFromPartition(), GenerateTypeDependencies(), heap_create_with_catalog(), index_create(), InsertExtensionTuple(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), makeParserDependencies(), makeTSTemplateDependencies(), performDeletion(), performMultipleDeletions(), PreCommit_on_commit_actions(), ProcedureCreate(), RangeCreate(), recordDependencyOnExpr(), recordDependencyOnSingleRelExpr(), ReindexRelationConcurrently(), RemoveObjects(), RemoveRelations(), shdepDropOwned(), and StorePartitionKey().
bool object_address_present | ( | const ObjectAddress * | object, |
const ObjectAddresses * | addrs | ||
) |
Definition at line 2593 of file dependency.c.
References ObjectAddress::classId, i, ObjectAddresses::numrefs, ObjectAddressStack::object, ObjectAddress::objectId, ObjectAddress::objectSubId, and ObjectAddresses::refs.
Referenced by AlterConstraintNamespaces(), AlterIndexNamespaces(), AlterRelationNamespaceInternal(), AlterTypeNamespaceInternal(), findDependentObjects(), and PreCommit_on_commit_actions().
void performDeletion | ( | const ObjectAddress * | object, |
DropBehavior | behavior, | ||
int | flags | ||
) |
Definition at line 273 of file dependency.c.
References AcquireDeletionLock(), deleteObjectsInList(), DEPFLAG_ORIGINAL, findDependentObjects(), ObjectAddressStack::flags, free_object_addresses(), new_object_addresses(), reportDependentObjects(), RowExclusiveLock, table_close(), and table_open().
Referenced by AlterDomainDropConstraint(), AlterDomainNotNull(), ATExecDropConstraint(), ATExecDropIdentity(), DetachPartitionFinalize(), do_autovacuum(), dropOperators(), dropProcedures(), finish_heap_swap(), inv_drop(), PublicationDropSchemas(), PublicationDropTables(), RemoveAttrDefault(), RemoveTempRelations(), RemoveUserMapping(), SetDefaultACL(), and tryAttachPartitionForeignKey().
void performMultipleDeletions | ( | const ObjectAddresses * | objects, |
DropBehavior | behavior, | ||
int | flags | ||
) |
Definition at line 332 of file dependency.c.
References AcquireDeletionLock(), deleteObjectsInList(), DEPFLAG_ORIGINAL, findDependentObjects(), ObjectAddressStack::flags, free_object_addresses(), i, new_object_addresses(), ObjectAddresses::numrefs, ObjectAddresses::refs, reportDependentObjects(), RowExclusiveLock, table_close(), and table_open().
Referenced by ATExecDropColumn(), DropClonedTriggersFromPartition(), PreCommit_on_commit_actions(), ReindexRelationConcurrently(), RemoveObjects(), RemoveRelations(), and shdepDropOwned().
void record_object_address_dependencies | ( | const ObjectAddress * | depender, |
ObjectAddresses * | referenced, | ||
DependencyType | behavior | ||
) |
Definition at line 2742 of file dependency.c.
References eliminate_duplicate_dependencies(), ObjectAddresses::numrefs, recordMultipleDependencies(), and ObjectAddresses::refs.
Referenced by AggregateCreate(), CastCreate(), CreateConstraintEntry(), CreateProceduralLanguage(), CreateTransform(), GenerateTypeDependencies(), heap_create_with_catalog(), index_create(), InsertExtensionTuple(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), makeParserDependencies(), makeTSTemplateDependencies(), ProcedureCreate(), RangeCreate(), and StorePartitionKey().
void recordDependencyOn | ( | const ObjectAddress * | depender, |
const ObjectAddress * | referenced, | ||
DependencyType | behavior | ||
) |
Definition at line 46 of file pg_depend.c.
References recordMultipleDependencies().
Referenced by add_column_collation_dependency(), add_column_datatype_dependency(), addFkRecurseReferenced(), addFkRecurseReferencing(), AddNewAttributeTuples(), AlterForeignDataWrapper(), AlterFunction(), AlterPolicy(), ApplyExtensionUpdates(), ATExecAddOf(), ATExecSetAccessMethodNoStorage(), changeDependencyFor(), CloneFkReferencing(), CollationCreate(), ConstraintSetParentConstraint(), ConversionCreate(), create_toast_table(), CreateAccessMethod(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateOpFamily(), CreatePolicy(), CreateStatistics(), CreateTriggerFiringOn(), CreateUserMapping(), DefineOpClass(), ExecAlterExtensionContentsRecurse(), ExecAlterObjectDependsStmt(), GenerateTypeDependencies(), index_constraint_create(), index_create(), IndexSetParentIndex(), insert_event_trigger_tuple(), InsertRule(), makeMultirangeConstructors(), makeRangeConstructors(), process_owned_by(), publication_add_relation(), publication_add_schema(), RangeCreate(), recordDependencyOnCurrentExtension(), recordDependencyOnSingleRelExpr(), SetDefaultACL(), StoreAttrDefault(), StoreCatalogInheritance1(), storeOperators(), StorePartitionKey(), storeProcedures(), swap_relation_files(), and TriggerSetParentTrigger().
void recordDependencyOnCurrentExtension | ( | const ObjectAddress * | object, |
bool | isReplace | ||
) |
Definition at line 194 of file pg_depend.c.
References Assert, ObjectAddress::classId, creating_extension, CurrentExtensionObject, DEPENDENCY_EXTENSION, ereport, errcode(), errdetail(), errmsg(), ERROR, get_extension_name(), getExtensionOfObject(), getObjectDescription(), ObjectAddress::objectId, ObjectAddress::objectSubId, OidIsValid, and recordDependencyOn().
Referenced by CastCreate(), CollationCreate(), ConversionCreate(), CreateAccessMethod(), CreateForeignDataWrapper(), CreateForeignServer(), CreateOpFamily(), CreateProceduralLanguage(), CreateTransform(), DefineOpClass(), DefineVirtualRelation(), GenerateTypeDependencies(), heap_create_with_catalog(), insert_event_trigger_tuple(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), makeParserDependencies(), makeTSTemplateDependencies(), NamespaceCreate(), and ProcedureCreate().
void recordDependencyOnExpr | ( | const ObjectAddress * | depender, |
Node * | expr, | ||
List * | rtable, | ||
DependencyType | behavior | ||
) |
Definition at line 1553 of file dependency.c.
References context, eliminate_duplicate_dependencies(), find_expr_references_walker(), free_object_addresses(), list_make1, new_object_addresses(), and recordMultipleDependencies().
Referenced by AlterPolicy(), CreatePolicy(), CreateTriggerFiringOn(), GenerateTypeDependencies(), InsertRule(), and ProcedureCreate().
Definition at line 168 of file pg_shdepend.c.
References ObjectAddress::classId, ObjectAddress::objectId, ObjectAddress::objectSubId, recordSharedDependencyOn(), and SHARED_DEPENDENCY_OWNER.
Referenced by CollationCreate(), ConversionCreate(), createdb(), CreateForeignDataWrapper(), CreateForeignServer(), CreateOpFamily(), CreateProceduralLanguage(), CreatePublication(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateUserMapping(), DefineOpClass(), GenerateTypeDependencies(), heap_create_with_catalog(), insert_event_trigger_tuple(), InsertExtensionTuple(), inv_create(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), NamespaceCreate(), ProcedureCreate(), and SetDefaultACL().
void recordDependencyOnSingleRelExpr | ( | const ObjectAddress * | depender, |
Node * | expr, | ||
Oid | relId, | ||
DependencyType | behavior, | ||
DependencyType | self_behavior, | ||
bool | reverse_self | ||
) |
Definition at line 1596 of file dependency.c.
References AccessShareLock, add_exact_object_address(), ObjectAddress::classId, context, eliminate_duplicate_dependencies(), find_expr_references_walker(), free_object_addresses(), list_make1, new_object_addresses(), ObjectAddresses::numrefs, ObjectAddress::objectId, recordDependencyOn(), recordMultipleDependencies(), ObjectAddresses::refs, RangeTblEntry::relid, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by CreateConstraintEntry(), CreateStatistics(), index_create(), publication_add_relation(), StoreAttrDefault(), and StorePartitionKey().
Definition at line 370 of file pg_shdepend.c.
References ObjectAddressSet, recordSharedDependencyOn(), SHARED_DEPENDENCY_TABLESPACE, and tablespace.
Referenced by heap_create().
void recordMultipleDependencies | ( | const ObjectAddress * | depender, |
const ObjectAddress * | referenced, | ||
int | nreferenced, | ||
DependencyType | behavior | ||
) |
Definition at line 58 of file pg_depend.c.
References CatalogCloseIndexes(), CatalogOpenIndexes(), CatalogTuplesMultiInsertWithInfo(), CharGetDatum(), ObjectAddress::classId, ExecClearTuple(), ExecDropSingleTupleTableSlot(), ExecStoreVirtualTuple(), FormData_pg_depend, i, Int32GetDatum(), IsBootstrapProcessingMode, isObjectPinned(), MakeSingleTupleTableSlot(), MAX_CATALOG_MULTI_INSERT_BYTES, Min, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, palloc(), pfree(), RelationGetDescr, RowExclusiveLock, table_close(), table_open(), TupleTableSlot::tts_values, and TTSOpsHeapTuple.
Referenced by record_object_address_dependencies(), recordDependencyOn(), recordDependencyOnExpr(), and recordDependencyOnSingleRelExpr().
void recordSharedDependencyOn | ( | ObjectAddress * | depender, |
ObjectAddress * | referenced, | ||
SharedDependencyType | deptype | ||
) |
Definition at line 125 of file pg_shdepend.c.
References Assert, ObjectAddress::classId, IsBootstrapProcessingMode, IsPinnedObject(), ObjectAddress::objectId, ObjectAddress::objectSubId, RowExclusiveLock, shdepAddDependency(), table_close(), and table_open().
Referenced by AlterPolicy(), CreatePolicy(), recordDependencyOnOwner(), recordDependencyOnTablespace(), and RemoveRoleFromObjectPolicy().
void ReleaseDeletionLock | ( | const ObjectAddress * | object | ) |
Definition at line 1528 of file dependency.c.
References AccessExclusiveLock, ObjectAddress::classId, ObjectAddressStack::object, ObjectAddress::objectId, UnlockDatabaseObject(), and UnlockRelationOid().
Referenced by findDependentObjects(), and shdepDropOwned().
Definition at line 829 of file pg_depend.c.
References AccessShareLock, BTEqualStrategyNumber, GETSTRUCT, HeapTupleIsValid, sort-test::key, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterTableNamespace(), ATExecChangeOwner(), and process_owned_by().
void shdepDropOwned | ( | List * | roleids, |
DropBehavior | behavior | ||
) |
Definition at line 1342 of file pg_shdepend.c.
References AcquireDeletionLock(), add_exact_object_address(), Assert, BTEqualStrategyNumber, ObjectAddress::classId, elog, ereport, errcode(), errmsg(), ERROR, free_object_addresses(), getObjectDescription(), GETSTRUCT, InvalidOid, IsPinnedObject(), sort-test::key, lfirst_oid, MyDatabaseId, new_object_addresses(), ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, performMultipleDeletions(), ReleaseDeletionLock(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RowExclusiveLock, ScanKeyInit(), SHARED_DEPENDENCY_ACL, SHARED_DEPENDENCY_INITACL, SHARED_DEPENDENCY_INVALID, SHARED_DEPENDENCY_OWNER, SHARED_DEPENDENCY_POLICY, sort_object_addresses(), systable_beginscan(), systable_endscan(), systable_getnext(), systable_recheck_tuple(), table_close(), and table_open().
Referenced by DropOwnedObjects().
Definition at line 1211 of file pg_shdepend.c.
References AccessShareLock, elog, ereport, errcode(), errmsg(), ERROR, get_database_name(), get_tablespace_name(), LockSharedObject(), ObjectIdGetDatum(), pfree(), SearchSysCacheExists1, and tablespace.
Referenced by AlterDatabaseSet(), AlterRoleSet(), shdepAddDependency(), and shdepChangeDep().
Definition at line 1530 of file pg_shdepend.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, BTEqualStrategyNumber, ObjectAddress::classId, CommandCounterIncrement(), CurrentMemoryContext, elog, ereport, errcode(), errmsg(), ERROR, getObjectDescription(), GETSTRUCT, InvalidOid, IsPinnedObject(), sort-test::key, lfirst_oid, MemoryContextDelete(), MemoryContextSwitchTo(), MyDatabaseId, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, RowExclusiveLock, ScanKeyInit(), SHARED_DEPENDENCY_ACL, SHARED_DEPENDENCY_INITACL, SHARED_DEPENDENCY_OWNER, SHARED_DEPENDENCY_POLICY, SHARED_DEPENDENCY_TABLESPACE, shdepReassignOwned_InitAcl(), shdepReassignOwned_Owner(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ReassignOwnedObjects().
void sort_object_addresses | ( | ObjectAddresses * | addrs | ) |
Definition at line 2761 of file dependency.c.
References ObjectAddresses::numrefs, object_address_comparator(), qsort, and ObjectAddresses::refs.
Referenced by shdepDropOwned().
void updateAclDependencies | ( | Oid | classId, |
Oid | objectId, | ||
int32 | objsubId, | ||
Oid | ownerId, | ||
int | noldmembers, | ||
Oid * | oldmembers, | ||
int | nnewmembers, | ||
Oid * | newmembers | ||
) |
Definition at line 491 of file pg_shdepend.c.
References SHARED_DEPENDENCY_ACL, and updateAclDependenciesWorker().
Referenced by AddRoleMems(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), recordDependencyOnNewAcl(), and SetDefaultACL().
void updateInitAclDependencies | ( | Oid | classId, |
Oid | objectId, | ||
int32 | objsubId, | ||
int | noldmembers, | ||
Oid * | oldmembers, | ||
int | nnewmembers, | ||
Oid * | newmembers | ||
) |
Definition at line 512 of file pg_shdepend.c.
References InvalidOid, SHARED_DEPENDENCY_INITACL, and updateAclDependenciesWorker().
Referenced by recordExtensionInitPrivWorker(), RemoveRoleFromInitPriv(), and ReplaceRoleInInitPriv().