PostgreSQL Source Code
git master
|
#include "catalog/objectaddress.h"
Go to the source code of this file.
Macros | |
#define | LAST_OCLASS OCLASS_TRANSFORM |
#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 |
typedef enum ObjectClass | ObjectClass |
#define LAST_OCLASS OCLASS_TRANSFORM |
Definition at line 133 of file dependency.h.
#define PERFORM_DELETION_CONCURRENT_LOCK |
Definition at line 141 of file dependency.h.
#define PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */ |
Definition at line 137 of file dependency.h.
#define PERFORM_DELETION_INTERNAL 0x0001 /* internal action */ |
Definition at line 136 of file dependency.h.
#define PERFORM_DELETION_QUIETLY 0x0004 /* suppress notices */ |
Definition at line 138 of file dependency.h.
#define PERFORM_DELETION_SKIP_EXTENSIONS 0x0010 /* keep extensions */ |
Definition at line 140 of file dependency.h.
#define PERFORM_DELETION_SKIP_ORIGINAL 0x0008 /* keep original obj */ |
Definition at line 139 of file dependency.h.
typedef enum DependencyType DependencyType |
typedef struct ObjectAddresses ObjectAddresses |
Definition at line 1 of file dependency.h.
typedef enum ObjectClass ObjectClass |
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 ObjectClass |
Definition at line 88 of file dependency.h.
enum SharedDependencyType |
Enumerator | |
---|---|
SHARED_DEPENDENCY_OWNER | |
SHARED_DEPENDENCY_ACL | |
SHARED_DEPENDENCY_POLICY | |
SHARED_DEPENDENCY_TABLESPACE | |
SHARED_DEPENDENCY_INVALID |
Definition at line 72 of file dependency.h.
void AcquireDeletionLock | ( | const ObjectAddress * | object, |
int | flags | ||
) |
Definition at line 1545 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 2581 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 564 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 620 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 456 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(), and AlterTypeNamespaceInternal().
Definition at line 313 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 382 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 257 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 631 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 850 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 300 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(), CreateProceduralLanguage(), CreateTransform(), CreateTriggerFiringOn(), GenerateTypeDependencies(), InsertRule(), makeConfigurationDependencies(), makeOperatorDependencies(), ProcedureCreate(), swap_relation_files(), and tryAttachPartitionForeignKey().
Definition at line 350 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(), ConstraintSetParentConstraint(), DetachPartitionFinalize(), DropClonedTriggersFromPartition(), ExecAlterExtensionContentsStmt(), index_constraint_create(), IndexSetParentIndex(), process_owned_by(), and TriggerSetParentTrigger().
long deleteDependencyRecordsForSpecific | ( | Oid | classId, |
Oid | objectId, | ||
char | deptype, | ||
Oid | refclassId, | ||
Oid | refobjectId | ||
) |
Definition at line 397 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 1002 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 954 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 2821 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 968 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 1024 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 777 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 731 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(), ExecAlterExtensionContentsStmt(), lookup_shippable(), pg_extension_config_dump(), and recordDependencyOnCurrentExtension().
Oid getIdentitySequence | ( | Oid | relid, |
AttrNumber | attnum, | ||
bool | missing_ok | ||
) |
Definition at line 944 of file pg_depend.c.
References attnum, DEPENDENCY_INTERNAL, elog(), ERROR, getOwnedSequences_internal(), InvalidOid, linitial_oid, list_length(), and NIL.
Referenced by ATExecDropIdentity(), build_column_default(), transformAlterTableStmt(), and transformTableLikeClause().
ObjectClass getObjectClass | ( | const ObjectAddress * | object | ) |
Definition at line 2836 of file dependency.c.
References ObjectAddress::classId, elog(), ERROR, ObjectAddressStack::object, ObjectAddress::objectSubId, OCLASS_AM, OCLASS_AMOP, OCLASS_AMPROC, OCLASS_CAST, OCLASS_CLASS, OCLASS_COLLATION, OCLASS_CONSTRAINT, OCLASS_CONVERSION, OCLASS_DATABASE, OCLASS_DEFACL, OCLASS_DEFAULT, OCLASS_EVENT_TRIGGER, OCLASS_EXTENSION, OCLASS_FDW, OCLASS_FOREIGN_SERVER, OCLASS_LANGUAGE, OCLASS_LARGEOBJECT, OCLASS_OPCLASS, OCLASS_OPERATOR, OCLASS_OPFAMILY, OCLASS_PARAMETER_ACL, OCLASS_POLICY, OCLASS_PROC, OCLASS_PUBLICATION, OCLASS_PUBLICATION_NAMESPACE, OCLASS_PUBLICATION_REL, OCLASS_REWRITE, OCLASS_ROLE, OCLASS_ROLE_MEMBERSHIP, OCLASS_SCHEMA, OCLASS_STATISTIC_EXT, OCLASS_SUBSCRIPTION, OCLASS_TBLSPACE, OCLASS_TRANSFORM, OCLASS_TRIGGER, OCLASS_TSCONFIG, OCLASS_TSDICT, OCLASS_TSPARSER, OCLASS_TSTEMPLATE, OCLASS_TYPE, and OCLASS_USER_MAPPING.
Referenced by AlterObjectNamespace_oid(), ATExecAlterColumnType(), deleteObjectsInList(), doDeletion(), EventTriggerSQLDropAddObject(), getObjectDescription(), getObjectIdentityParts(), and getObjectTypeDescription().
Definition at line 935 of file pg_depend.c.
References getOwnedSequences_internal().
Referenced by ATRewriteTables(), and ExecuteTruncateGuts().
ObjectAddresses* new_object_addresses | ( | void | ) |
Definition at line 2532 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 2641 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 328 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(), 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 387 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 2790 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 44 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(), changeDependencyFor(), CloneFkReferencing(), CollationCreate(), ConstraintSetParentConstraint(), ConversionCreate(), create_toast_table(), CreateAccessMethod(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateOpFamily(), CreatePolicy(), CreateStatistics(), CreateTriggerFiringOn(), CreateUserMapping(), DefineOpClass(), ExecAlterExtensionContentsStmt(), 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 192 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 1602 of file dependency.c.
References find_expr_references_context::addrs, eliminate_duplicate_dependencies(), find_expr_references_walker(), free_object_addresses(), list_make1, new_object_addresses(), ObjectAddresses::numrefs, recordMultipleDependencies(), ObjectAddresses::refs, and find_expr_references_context::rtables.
Referenced by AlterPolicy(), CreatePolicy(), CreateTriggerFiringOn(), GenerateTypeDependencies(), InsertRule(), and ProcedureCreate().
Definition at line 165 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 1645 of file dependency.c.
References AccessShareLock, add_exact_object_address(), find_expr_references_context::addrs, ObjectAddress::classId, 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, RangeTblEntry::relkind, RangeTblEntry::rellockmode, find_expr_references_context::rtables, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by CreateConstraintEntry(), CreateStatistics(), index_create(), publication_add_relation(), StoreAttrDefault(), and StorePartitionKey().
Definition at line 361 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 56 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 122 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 1577 of file dependency.c.
References AccessExclusiveLock, ObjectAddress::classId, ObjectAddressStack::object, ObjectAddress::objectId, UnlockDatabaseObject(), and UnlockRelationOid().
Referenced by findDependentObjects(), and shdepDropOwned().
Definition at line 827 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 1295 of file pg_shdepend.c.
References AcquireDeletionLock(), add_exact_object_address(), 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(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RowExclusiveLock, ScanKeyInit(), SHARED_DEPENDENCY_ACL, 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 1166 of file pg_shdepend.c.
References AccessShareLock, AUTHOID, 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 1468 of file pg_shdepend.c.
References AccessExclusiveLock, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AlterEventTriggerOwner_oid(), AlterForeignDataWrapperOwner_oid(), AlterForeignServerOwner_oid(), AlterObjectOwner_internal(), AlterPublicationOwner_oid(), AlterSchemaOwner_oid(), AlterSubscriptionOwner_oid(), AlterTypeOwner_oid(), ATExecChangeOwner(), BTEqualStrategyNumber, ObjectAddress::classId, CommandCounterIncrement(), CurrentMemoryContext, elog(), ereport, errcode(), errmsg(), ERROR, getObjectDescription(), GETSTRUCT, InvalidOid, IsPinnedObject(), sort-test::key, lfirst_oid, MemoryContextDelete(), MemoryContextSwitchTo(), MyDatabaseId, NoLock, ObjectAddress::objectId, ObjectIdGetDatum(), ObjectAddress::objectSubId, RowExclusiveLock, ScanKeyInit(), SHARED_DEPENDENCY_OWNER, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ReassignOwnedObjects().
void sort_object_addresses | ( | ObjectAddresses * | addrs | ) |
Definition at line 2809 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 482 of file pg_shdepend.c.
References getOidListDiff(), i, IsPinnedObject(), pfree(), RowExclusiveLock, SHARED_DEPENDENCY_ACL, shdepAddDependency(), shdepDropDependency(), table_close(), and table_open().
Referenced by AddRoleMems(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), recordDependencyOnNewAcl(), and SetDefaultACL().