PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/dependency.h"
#include "catalog/heap.h"
#include "catalog/index.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_am.h"
#include "catalog/pg_amop.h"
#include "catalog/pg_amproc.h"
#include "catalog/pg_attrdef.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_cast.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
#include "catalog/pg_conversion.h"
#include "catalog/pg_database.h"
#include "catalog/pg_default_acl.h"
#include "catalog/pg_depend.h"
#include "catalog/pg_event_trigger.h"
#include "catalog/pg_extension.h"
#include "catalog/pg_foreign_data_wrapper.h"
#include "catalog/pg_foreign_server.h"
#include "catalog/pg_init_privs.h"
#include "catalog/pg_language.h"
#include "catalog/pg_largeobject.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_opfamily.h"
#include "catalog/pg_policy.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_publication.h"
#include "catalog/pg_publication_rel.h"
#include "catalog/pg_rewrite.h"
#include "catalog/pg_statistic_ext.h"
#include "catalog/pg_subscription.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_transform.h"
#include "catalog/pg_trigger.h"
#include "catalog/pg_ts_config.h"
#include "catalog/pg_ts_dict.h"
#include "catalog/pg_ts_parser.h"
#include "catalog/pg_ts_template.h"
#include "catalog/pg_type.h"
#include "catalog/pg_user_mapping.h"
#include "commands/comment.h"
#include "commands/defrem.h"
#include "commands/event_trigger.h"
#include "commands/extension.h"
#include "commands/policy.h"
#include "commands/publicationcmds.h"
#include "commands/seclabel.h"
#include "commands/sequence.h"
#include "commands/trigger.h"
#include "commands/typecmds.h"
#include "nodes/nodeFuncs.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteRemove.h"
#include "storage/lmgr.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | ObjectAddressExtra |
struct | ObjectAddresses |
struct | ObjectAddressStack |
struct | ObjectAddressAndFlags |
struct | find_expr_references_context |
Macros | |
#define | DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */ |
#define | DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */ |
#define | DEPFLAG_AUTO 0x0004 /* reached via auto dependency */ |
#define | DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */ |
#define | DEPFLAG_PARTITION 0x0010 /* reached via partition dependency */ |
#define | DEPFLAG_EXTENSION 0x0020 /* reached via extension dependency */ |
#define | DEPFLAG_REVERSE 0x0040 /* reverse internal/extension link */ |
#define | DEPFLAG_IS_PART 0x0080 /* has a partition dependency */ |
#define | DEPFLAG_SUBOBJECT 0x0100 /* subobject of another deletable object */ |
#define | MAX_REPORTED_DEPS 100 |
Typedefs | |
typedef struct ObjectAddressStack | ObjectAddressStack |
Variables | |
static const Oid | object_classes [] |
#define DEPFLAG_AUTO 0x0004 /* reached via auto dependency */ |
Definition at line 100 of file dependency.c.
Referenced by findDependentObjects(), and reportDependentObjects().
#define DEPFLAG_EXTENSION 0x0020 /* reached via extension dependency */ |
Definition at line 103 of file dependency.c.
Referenced by findDependentObjects(), and reportDependentObjects().
#define DEPFLAG_INTERNAL 0x0008 /* reached via internal dependency */ |
Definition at line 101 of file dependency.c.
Referenced by findDependentObjects(), and reportDependentObjects().
#define DEPFLAG_IS_PART 0x0080 /* has a partition dependency */ |
Definition at line 105 of file dependency.c.
Referenced by findDependentObjects(), and reportDependentObjects().
#define DEPFLAG_NORMAL 0x0002 /* reached via normal dependency */ |
Definition at line 99 of file dependency.c.
Referenced by deleteObjectsInList(), and findDependentObjects().
#define DEPFLAG_ORIGINAL 0x0001 /* an original deletion target */ |
Definition at line 98 of file dependency.c.
Referenced by deleteObjectsInList(), performDeletion(), performMultipleDeletions(), and reportDependentObjects().
#define DEPFLAG_PARTITION 0x0010 /* reached via partition dependency */ |
Definition at line 102 of file dependency.c.
Referenced by findDependentObjects(), and reportDependentObjects().
#define DEPFLAG_REVERSE 0x0040 /* reverse internal/extension link */ |
Definition at line 104 of file dependency.c.
Referenced by deleteObjectsInList(), and findDependentObjects().
#define DEPFLAG_SUBOBJECT 0x0100 /* subobject of another deletable object */ |
Definition at line 106 of file dependency.c.
Referenced by object_address_present_add_flags(), reportDependentObjects(), and stack_address_present_add_flags().
#define MAX_REPORTED_DEPS 100 |
Referenced by reportDependentObjects().
typedef struct ObjectAddressStack ObjectAddressStack |
void AcquireDeletionLock | ( | const ObjectAddress * | object, |
int | flags | ||
) |
Definition at line 1603 of file dependency.c.
References AccessExclusiveLock, ObjectAddress::classId, LockDatabaseObject(), LockRelationOid(), 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 2610 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(), recordDependencyOnCollations(), recordDependencyOnSingleRelExpr(), ReindexRelationConcurrently(), RemoveObjects(), RemoveRelations(), shdepDropOwned(), and StorePartitionKey().
|
static |
Definition at line 2635 of file dependency.c.
References ObjectAddresses::extras, ObjectAddresses::maxrefs, ObjectAddresses::numrefs, ObjectAddressStack::object, palloc(), ObjectAddresses::refs, and repalloc().
Referenced by findDependentObjects().
|
static |
Definition at line 2577 of file dependency.c.
References Assert, ObjectAddress::classId, ObjectAddresses::extras, LAST_OCLASS, lengthof, ObjectAddresses::maxrefs, ObjectAddresses::numrefs, object_classes, ObjectAddress::objectId, ObjectAddress::objectSubId, ObjectAddresses::refs, repalloc(), and StaticAssertStmt.
Referenced by find_expr_references_walker().
|
static |
Definition at line 3001 of file dependency.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), ObjectAddress::classId, HeapTupleIsValid, InitPrivsObjIndexId, Int32GetDatum, 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 deleteOneObject().
|
static |
Definition at line 225 of file dependency.c.
References deleteOneObject(), DEPFLAG_NORMAL, DEPFLAG_ORIGINAL, DEPFLAG_REVERSE, EventTriggerSQLDropAddObject(), EventTriggerSupportsObjectClass(), ObjectAddresses::extras, ObjectAddressExtra::flags, getObjectClass(), i, ObjectAddresses::numrefs, PERFORM_DELETION_INTERNAL, PERFORM_DELETION_SKIP_ORIGINAL, ObjectAddresses::refs, and trackDroppedObjectsNeeded().
Referenced by performDeletion(), and performMultipleDeletions().
|
static |
Referenced by deleteObjectsInList().
|
static |
Definition at line 1361 of file dependency.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), ObjectAddress::classId, CommandCounterIncrement(), DeleteComments(), DeleteInitPrivs(), DeleteSecurityLabel(), deleteSharedDependencyRecordsFor(), DependDependerIndexId, doDeletion(), HeapTupleIsValid, Int32GetDatum, InvokeObjectDropHookArg, sort-test::key, ObjectAddress::objectId, ObjectIdGetDatum, ObjectAddress::objectSubId, PERFORM_DELETION_CONCURRENTLY, RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
|
static |
Definition at line 1465 of file dependency.c.
References Assert, DeleteSequenceTuple(), DropObjectById(), elog, ERROR, get_rel_relkind(), getObjectClass(), heap_drop_with_catalog(), index_drop(), LargeObjectDrop(), ObjectAddress::objectId, 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_POLICY, OCLASS_PROC, OCLASS_PUBLICATION, OCLASS_PUBLICATION_REL, OCLASS_REWRITE, OCLASS_ROLE, OCLASS_SCHEMA, OCLASS_STATISTIC_EXT, OCLASS_SUBSCRIPTION, OCLASS_TBLSPACE, OCLASS_TRANSFORM, OCLASS_TRIGGER, OCLASS_TSCONFIG, OCLASS_TSDICT, OCLASS_TSPARSER, OCLASS_TSTEMPLATE, OCLASS_TYPE, OCLASS_USER_MAPPING, PERFORM_DELETION_CONCURRENT_LOCK, PERFORM_DELETION_CONCURRENTLY, RemoveAttrDefaultById(), RemoveAttributeById(), RemoveConstraintById(), RemoveExtensionById(), RemoveFunctionById(), RemoveOperatorById(), RemovePolicyById(), RemovePublicationRelById(), RemoveRewriteRuleById(), RemoveStatisticsById(), RemoveTriggerById(), RemoveTSConfigurationById(), and RemoveTypeById().
Referenced by deleteOneObject().
|
static |
Definition at line 1304 of file dependency.c.
References BTEqualStrategyNumber, CatalogTupleDelete(), ObjectAddress::classId, elog, ERROR, get_object_attnum_oid(), get_object_catcache_oid(), get_object_class_descr(), get_object_oid_index(), HeapTupleIsValid, ObjectAddress::objectId, ObjectIdGetDatum, ReleaseSysCache(), RowExclusiveLock, ScanKeyInit(), SearchSysCache1(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by doDeletion().
|
static |
Definition at line 2451 of file dependency.c.
References Assert, ObjectAddress::classId, ObjectAddresses::extras, ObjectAddresses::numrefs, object_address_comparator(), ObjectAddress::objectId, ObjectAddress::objectSubId, qsort, and ObjectAddresses::refs.
Referenced by record_object_address_dependencies(), recordDependencyOnCollations(), recordDependencyOnExpr(), and recordDependencyOnSingleRelExpr().
|
static |
Definition at line 1842 of file dependency.c.
References add_object_address(), find_expr_references_context::addrs, Aggref::aggfnoid, FieldSelect::arg, CMD_INSERT, CMD_UPDATE, TableFunc::colcollations, CollateExpr::collOid, TableFunc::coltypes, Query::commandType, Const::constcollid, Const::constisnull, OnConflictExpr::constraint, Query::constraintDeps, Const::consttype, Const::constvalue, DatumGetObjectId, elog, WindowClause::endInRangeFunc, SortGroupClause::eqop, ereport, errcode(), errmsg(), ERROR, expression_tree_walker(), exprType(), FieldSelect::fieldnum, FieldStore::fieldnums, FirstNormalObjectId, RangeTblFunction::funccolcollations, RangeTblFunction::funccoltypes, FuncExpr::funcid, get_typ_typrelid(), getBaseType(), GetTypeCollations(), SetOperationStmt::groupClauses, i, WindowClause::inRangeColl, InvalidAttrNumber, IsA, RangeTblEntry::joinaliasvars, RangeTblEntry::joinmergedcols, lcons(), lfirst, lfirst_int, lfirst_oid, list_delete_first(), list_length(), list_nth(), NAMESPACEOID, ObjectIdGetDatum, OCLASS_CLASS, OCLASS_COLLATION, OCLASS_CONSTRAINT, OCLASS_OPERATOR, OCLASS_OPFAMILY, OCLASS_PROC, OCLASS_SCHEMA, OCLASS_TSCONFIG, OCLASS_TSDICT, OCLASS_TYPE, OidIsValid, OPEROID, RowCompareExpr::opfamilies, OpExpr::opno, ScalarArrayOpExpr::opno, RowCompareExpr::opnos, Param::paramcollid, Param::paramtype, PROCOID, QTW_EXAMINE_SORTGROUP, QTW_IGNORE_JOINALIASES, query_tree_walker(), SubscriptingRef::refcontainertype, SubscriptingRef::refelemtype, SubscriptingRef::refrestype, RangeTblEntry::relid, RELOID, TargetEntry::resjunk, TargetEntry::resno, FieldSelect::resultcollid, RelabelType::resultcollid, CoerceViaIO::resultcollid, ArrayCoerceExpr::resultcollid, Query::resultRelation, FieldSelect::resulttype, FieldStore::resulttype, RelabelType::resulttype, CoerceViaIO::resulttype, ArrayCoerceExpr::resulttype, ConvertRowtypeExpr::resulttype, CoerceToDomain::resulttype, RowExpr::row_typeid, rt_fetch, Query::rtable, find_expr_references_context::rtables, RTE_JOIN, RTE_RELATION, RangeTblEntry::rtekind, SearchSysCacheExists1, NextValueExpr::seqid, SortGroupClause::sortop, WindowClause::startInRangeFunc, Query::targetList, TSCONFIGOID, TSDICTOID, TableSampleClause::tsmhandler, TYPEOID, Var::varattno, Var::varcollid, Var::varlevelsup, Var::varno, Var::vartype, and WindowFunc::winfnoid.
Referenced by recordDependencyOnExpr(), and recordDependencyOnSingleRelExpr().
|
static |
Definition at line 550 of file dependency.c.
References AcquireDeletionLock(), add_exact_object_address_extra(), BTEqualStrategyNumber, ObjectAddress::classId, creating_extension, CurrentExtensionObject, DependDependerIndexId, ObjectAddressExtra::dependee, DEPENDENCY_AUTO, DEPENDENCY_AUTO_EXTENSION, DEPENDENCY_EXTENSION, DEPENDENCY_INTERNAL, DEPENDENCY_NORMAL, DEPENDENCY_PARTITION_PRI, DEPENDENCY_PARTITION_SEC, DEPENDENCY_PIN, DependReferenceIndexId, DEPFLAG_AUTO, DEPFLAG_EXTENSION, DEPFLAG_INTERNAL, DEPFLAG_IS_PART, DEPFLAG_NORMAL, DEPFLAG_PARTITION, DEPFLAG_REVERSE, elog, ereport, errcode(), errhint(), errmsg(), ERROR, ObjectAddressExtra::flags, ObjectAddressStack::flags, getObjectDescription(), GETSTRUCT, HeapTupleIsValid, i, Int32GetDatum, sort-test::key, ObjectAddressStack::next, ObjectAddressAndFlags::obj, ObjectAddressStack::object, object_address_comparator(), object_address_present(), object_address_present_add_flags(), ObjectAddress::objectId, ObjectIdGetDatum, ObjectAddress::objectSubId, OidIsValid, palloc(), PERFORM_DELETION_SKIP_EXTENSIONS, pfree(), qsort, ReleaseDeletionLock(), repalloc(), ScanKeyInit(), stack_address_present_add_flags(), ObjectAddressAndFlags::subflags, systable_beginscan(), systable_endscan(), systable_getnext(), and systable_recheck_tuple().
Referenced by performDeletion(), and performMultipleDeletions().
void free_object_addresses | ( | ObjectAddresses * | addrs | ) |
Definition at line 2851 of file dependency.c.
References ObjectAddresses::extras, pfree(), and ObjectAddresses::refs.
Referenced by AggregateCreate(), AlterTableNamespace(), AlterTypeNamespace(), ATExecDropColumn(), ATPostAlterTypeCleanup(), CastCreate(), CreateConstraintEntry(), CreateProceduralLanguage(), CreateTransform(), DropClonedTriggersFromPartition(), GenerateTypeDependencies(), heap_create_with_catalog(), index_create(), InsertExtensionTuple(), makeConfigurationDependencies(), makeDictionaryDependencies(), makeOperatorDependencies(), makeParserDependencies(), makeTSTemplateDependencies(), performDeletion(), performMultipleDeletions(), ProcedureCreate(), RangeCreate(), recordDependencyOnCollations(), recordDependencyOnExpr(), recordDependencyOnSingleRelExpr(), RemoveObjects(), RemoveRelations(), shdepDropOwned(), and StorePartitionKey().
ObjectClass getObjectClass | ( | const ObjectAddress * | object | ) |
Definition at line 2866 of file dependency.c.
References ObjectAddress::classId, elog, ERROR, 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_POLICY, OCLASS_PROC, OCLASS_PUBLICATION, OCLASS_PUBLICATION_REL, OCLASS_REWRITE, OCLASS_ROLE, 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().
ObjectAddresses* new_object_addresses | ( | void | ) |
Definition at line 2555 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(), recordDependencyOnCollations(), recordDependencyOnExpr(), recordDependencyOnSingleRelExpr(), ReindexRelationConcurrently(), RemoveObjects(), RemoveRelations(), shdepDropOwned(), and StorePartitionKey().
|
static |
Definition at line 2511 of file dependency.c.
References ObjectAddress::classId, ObjectAddress::objectId, and ObjectAddress::objectSubId.
Referenced by eliminate_duplicate_dependencies(), findDependentObjects(), and sort_object_addresses().
bool object_address_present | ( | const ObjectAddress * | object, |
const ObjectAddresses * | addrs | ||
) |
Definition at line 2670 of file dependency.c.
References ObjectAddress::classId, i, ObjectAddresses::numrefs, ObjectAddress::objectId, ObjectAddress::objectSubId, and ObjectAddresses::refs.
Referenced by AlterConstraintNamespaces(), AlterIndexNamespaces(), AlterRelationNamespaceInternal(), AlterTypeNamespaceInternal(), findDependentObjects(), and PreCommit_on_commit_actions().
|
static |
Definition at line 2696 of file dependency.c.
References ObjectAddress::classId, DEPFLAG_SUBOBJECT, ObjectAddresses::extras, ObjectAddressExtra::flags, ObjectAddressStack::flags, i, ObjectAddresses::numrefs, ObjectAddress::objectId, ObjectAddress::objectSubId, and ObjectAddresses::refs.
Referenced by findDependentObjects().
void performDeletion | ( | const ObjectAddress * | object, |
DropBehavior | behavior, | ||
int | flags | ||
) |
Definition at line 313 of file dependency.c.
References AcquireDeletionLock(), deleteObjectsInList(), DEPFLAG_ORIGINAL, findDependentObjects(), free_object_addresses(), new_object_addresses(), reportDependentObjects(), RowExclusiveLock, table_close(), and table_open().
Referenced by AlterDomainDropConstraint(), ATExecDetachPartition(), ATExecDropConstraint(), ATExecDropIdentity(), DefineQueryRewrite(), do_autovacuum(), dropOperators(), dropProcedures(), finish_heap_swap(), inv_drop(), PublicationDropTables(), RemoveAttrDefault(), RemoveTempRelations(), RemoveUserMapping(), SetDefaultACL(), and tryAttachPartitionForeignKey().
void performMultipleDeletions | ( | const ObjectAddresses * | objects, |
DropBehavior | behavior, | ||
int | flags | ||
) |
Definition at line 372 of file dependency.c.
References AcquireDeletionLock(), deleteObjectsInList(), DEPFLAG_ORIGINAL, findDependentObjects(), free_object_addresses(), i, new_object_addresses(), ObjectAddresses::numrefs, ObjectAddresses::refs, reportDependentObjects(), RowExclusiveLock, table_close(), and table_open().
Referenced by ATExecDropColumn(), ATPostAlterTypeCleanup(), 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 2819 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 recordDependencyOnCollations | ( | ObjectAddress * | myself, |
List * | collations, | ||
bool | record_version | ||
) |
Definition at line 1647 of file dependency.c.
References add_exact_object_address(), DEPENDENCY_NORMAL, eliminate_duplicate_dependencies(), free_object_addresses(), lfirst_oid, list_length(), new_object_addresses(), ObjectAddresses::numrefs, ObjectAddressSet, recordMultipleDependencies(), and ObjectAddresses::refs.
Referenced by index_create().
void recordDependencyOnExpr | ( | const ObjectAddress * | depender, |
Node * | expr, | ||
List * | rtable, | ||
DependencyType | behavior | ||
) |
Definition at line 1689 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(), CreateTrigger(), GenerateTypeDependencies(), InsertRule(), ProcedureCreate(), and RemoveRoleFromObjectPolicy().
void recordDependencyOnSingleRelExpr | ( | const ObjectAddress * | depender, |
Node * | expr, | ||
Oid | relId, | ||
DependencyType | behavior, | ||
DependencyType | self_behavior, | ||
bool | reverse_self, | ||
bool | record_version | ||
) |
Definition at line 1734 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, MemSet, new_object_addresses(), ObjectAddresses::numrefs, ObjectAddress::objectId, recordDependencyOn(), recordMultipleDependencies(), ObjectAddresses::refs, RangeTblEntry::relid, RangeTblEntry::relkind, RangeTblEntry::rellockmode, find_expr_references_context::rtables, RTE_RELATION, RangeTblEntry::rtekind, T_RangeTblEntry, and RangeTblEntry::type.
Referenced by CreateConstraintEntry(), index_create(), StoreAttrDefault(), and StorePartitionKey().
void ReleaseDeletionLock | ( | const ObjectAddress * | object | ) |
Definition at line 1632 of file dependency.c.
References AccessExclusiveLock, ObjectAddress::classId, ObjectAddress::objectId, UnlockDatabaseObject(), and UnlockRelationOid().
Referenced by findDependentObjects(), and shdepDropOwned().
|
static |
Definition at line 1103 of file dependency.c.
References _, appendStringInfo(), appendStringInfoChar(), StringInfoData::data, DEBUG2, ObjectAddressExtra::dependee, DEPFLAG_AUTO, DEPFLAG_EXTENSION, DEPFLAG_INTERNAL, DEPFLAG_IS_PART, DEPFLAG_ORIGINAL, DEPFLAG_PARTITION, DEPFLAG_SUBOBJECT, DROP_CASCADE, DROP_RESTRICT, ereport, errcode(), errdetail(), errdetail_log(), errhint(), errmsg(), errmsg_internal(), errmsg_plural(), ERROR, ObjectAddresses::extras, ObjectAddressExtra::flags, getObjectDescription(), i, initStringInfo(), StringInfoData::len, MAX_REPORTED_DEPS, message_level_is_interesting(), ngettext, NOTICE, ObjectAddresses::numrefs, PERFORM_DELETION_QUIETLY, pfree(), and ObjectAddresses::refs.
Referenced by performDeletion(), and performMultipleDeletions().
void sort_object_addresses | ( | ObjectAddresses * | addrs | ) |
Definition at line 2839 of file dependency.c.
References ObjectAddresses::numrefs, object_address_comparator(), qsort, and ObjectAddresses::refs.
Referenced by shdepDropOwned().
|
static |
Definition at line 2769 of file dependency.c.
References ObjectAddress::classId, DEPFLAG_SUBOBJECT, ObjectAddressStack::flags, ObjectAddressStack::next, ObjectAddressStack::object, ObjectAddress::objectId, and ObjectAddress::objectSubId.
Referenced by findDependentObjects().
void visitDependenciesOf | ( | const ObjectAddress * | object, |
VisitDependenciesOfCB | callback, | ||
void * | userdata | ||
) |
Definition at line 443 of file dependency.c.
References BTEqualStrategyNumber, callback(), CatalogTupleUpdate(), ObjectAddress::classId, CStringGetTextDatum, DependDependerIndexId, GETSTRUCT, heap_freetuple(), heap_getattr, heap_modify_tuple(), HeapTupleIsValid, Int32GetDatum, sort-test::key, ObjectAddress::objectId, ObjectIdGetDatum, ObjectAddress::objectSubId, RelationGetDescr, RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), table_open(), TextDatumGetCString, and values.
Referenced by index_check_collation_versions(), and index_update_collation_versions().
|
static |
Definition at line 146 of file dependency.c.
Referenced by add_object_address().