|
PostgreSQL Source Code git master
|
#include "catalog/dependency.h"#include "catalog/genbki.h"#include "catalog/pg_constraint_d.h"#include "nodes/pg_list.h"

Go to the source code of this file.
Typedefs | |
| typedef FormData_pg_constraint * | Form_pg_constraint |
| typedef enum ConstraintCategory | ConstraintCategory |
Enumerations | |
| enum | ConstraintCategory { CONSTRAINT_RELATION , CONSTRAINT_DOMAIN , CONSTRAINT_ASSERTION } |
Variables | |
| FormData_pg_constraint | |
Definition at line 175 of file pg_constraint.h.
| Enumerator | |
|---|---|
| CONSTRAINT_RELATION | |
| CONSTRAINT_DOMAIN | |
| CONSTRAINT_ASSERTION | |
Definition at line 213 of file pg_constraint.h.
|
extern |
Definition at line 741 of file pg_constraint.c.
References attnum, CatalogTupleUpdate(), ereport, errcode(), errhint(), errmsg(), ERROR, fb(), findNotNullConstraintAttnum(), get_rel_name(), GETSTRUCT(), HeapTupleIsValid, NameStr, pg_add_s16_overflow(), RowExclusiveLock, table_close(), and table_open().
Referenced by AddRelationNewConstraints().
|
extern |
Definition at line 1040 of file pg_constraint.c.
References add_exact_object_address(), BTEqualStrategyNumber, CatalogTupleUpdate(), fb(), GETSTRUCT(), heap_copytuple(), HeapTupleIsValid, InvalidOid, InvokeObjectPostAlterHook, object_address_present(), ObjectAddressSet, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterTableNamespaceInternal(), and AlterTypeNamespaceInternal().
| CATALOG | ( | pg_constraint | , |
| 2606 | , | ||
| ConstraintRelationId | |||
| ) |
Definition at line 31 of file pg_constraint.h.
References BKI_LOOKUP, BKI_LOOKUP_OPT, and fb().
|
extern |
Definition at line 1725 of file pg_constraint.c.
References bms_add_member(), bms_is_subset(), fb(), FirstLowInvalidHeapAttributeNumber, get_primary_key_attnos(), IsA, lappend_oid(), and lfirst.
Referenced by init_grouping_targets(), and substitute_grouped_columns_mutator().
|
extern |
Definition at line 513 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, CStringGetDatum(), fb(), HeapTupleIsValid, label, lfirst, makeObjectName(), NAMEDATALEN, ObjectIdGetDatum(), pfree(), ScanKeyInit(), snprintf, strlcpy(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by addFkConstraint(), AddRelationNewConstraints(), AddRelationNotNullConstraints(), ATExecAddConstraint(), ATExecSetNotNull(), domainAddCheckConstraint(), and domainAddNotNullConstraint().
Definition at line 457 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, CStringGetDatum(), fb(), HeapTupleIsValid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ChooseRelationName().
|
extern |
Definition at line 412 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, CONSTRAINT_DOMAIN, CONSTRAINT_RELATION, CStringGetDatum(), fb(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by addFkConstraint(), AddRelationNewConstraints(), ATExecAddConstraint(), domainAddCheckConstraint(), domainAddNotNullConstraint(), index_create(), and RenameConstraintById().
|
extern |
Definition at line 1109 of file pg_constraint.c.
References Assert, CatalogTupleUpdate(), deleteDependencyRecordsForClass(), DEPENDENCY_PARTITION_PRI, DEPENDENCY_PARTITION_SEC, elog, ereport, errcode(), errmsg(), ERROR, fb(), GETSTRUCT(), heap_copytuple(), HeapTupleIsValid, InvalidOid, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, pg_add_s16_overflow(), recordDependencyOn(), ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), HeapTupleData::t_self, table_close(), and table_open().
Referenced by ATExecAttachPartitionIdx(), AttachPartitionEnsureIndexes(), AttachPartitionForeignKey(), DefineIndex(), and DetachPartitionFinalize().
|
extern |
Definition at line 51 of file pg_constraint.c.
References add_exact_object_address(), Assert, BoolGetDatum(), CatalogTupleInsert(), CharGetDatum(), ObjectAddress::classId, construct_array_builtin(), CStringGetTextDatum, DEPENDENCY_AUTO, DEPENDENCY_NORMAL, fb(), free_object_addresses(), GetNewOidWithIndex(), heap_form_tuple(), i, Int16GetDatum(), InvokeObjectPostCreateHookArg, Max, NameGetDatum(), namestrcpy(), new_object_addresses(), ObjectAddressSet, ObjectAddressSubSet, ObjectIdGetDatum(), OidIsValid, palloc(), PointerGetDatum(), record_object_address_dependencies(), recordDependencyOnSingleRelExpr(), RelationGetDescr, RowExclusiveLock, table_close(), table_open(), and values.
Referenced by addFkConstraint(), CreateTriggerFiringOn(), domainAddCheckConstraint(), domainAddNotNullConstraint(), index_constraint_create(), StoreRelCheck(), and StoreRelNotNull().
| DECLARE_ARRAY_FOREIGN_KEY | ( | (confrelid, confkey) | , |
| pg_attribute | , | ||
| (attrelid, attnum) | |||
| ) |
| DECLARE_ARRAY_FOREIGN_KEY_OPT | ( | (conrelid, conkey) | , |
| pg_attribute | , | ||
| (attrelid, attnum) | |||
| ) |
| DECLARE_INDEX | ( | pg_constraint_conname_nsp_index | , |
| 2664 | , | ||
| ConstraintNameNspIndexId | , | ||
| pg_constraint | , | ||
| btree(conname name_ops, connamespace oid_ops) | |||
| ) |
| DECLARE_INDEX | ( | pg_constraint_conparentid_index | , |
| 2579 | , | ||
| ConstraintParentIndexId | , | ||
| pg_constraint | , | ||
| btree(conparentid oid_ops) | |||
| ) |
| DECLARE_INDEX | ( | pg_constraint_contypid_index | , |
| 2666 | , | ||
| ConstraintTypidIndexId | , | ||
| pg_constraint | , | ||
| btree(contypid oid_ops) | |||
| ) |
| DECLARE_TOAST | ( | pg_constraint | , |
| 2832 | , | ||
| 2833 | |||
| ) |
| DECLARE_UNIQUE_INDEX | ( | pg_constraint_conrelid_contypid_conname_index | , |
| 2665 | , | ||
| ConstraintRelidTypidNameIndexId | , | ||
| pg_constraint | , | ||
| btree(conrelid oid_ops, contypid oid_ops, conname name_ops) | |||
| ) |
| DECLARE_UNIQUE_INDEX_PKEY | ( | pg_constraint_oid_index | , |
| 2667 | , | ||
| ConstraintOidIndexId | , | ||
| pg_constraint | , | ||
| btree(oid oid_ops) | |||
| ) |
|
extern |
Definition at line 1521 of file pg_constraint.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, DatumGetArrayTypeP, DatumGetPointer(), elog, ERROR, fb(), INDEX_MAX_KEYS, pfree(), SysCacheGetAttr(), and SysCacheGetAttrNotNull().
Referenced by CloneFkReferenced(), CloneFkReferencing(), DetachPartitionFinalize(), RelationGetFKeyList(), and ri_LoadConstraintInfo().
|
extern |
Definition at line 702 of file pg_constraint.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, Assert, DatumGetArrayTypeP, elog, ERROR, fb(), GETSTRUCT(), and SysCacheGetAttrNotNull().
Referenced by ATExecAlterConstrInheritability(), CheckNNConstraintFetch(), dropconstraint_internal(), findNotNullConstraintAttnum(), MergeConstraintsIntoExisting(), pg_get_constraintdef_worker(), QueueNNConstraintValidation(), RelationGetNotNullConstraints(), and RemoveInheritance().
Definition at line 658 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, fb(), GETSTRUCT(), heap_copytuple(), HeapTupleIsValid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterDomainNotNull().
|
extern |
Definition at line 1651 of file pg_constraint.c.
References COMPARE_CONTAINED_BY, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), get_opclass_opfamily_and_input_type(), GetOperatorFromCompareType(), and InvalidOid.
Referenced by ATAddForeignKeyConstraint(), and ri_LoadConstraintInfo().
Definition at line 642 of file pg_constraint.c.
References attnum, fb(), findNotNullConstraintAttnum(), get_attnum(), and InvalidAttrNumber.
Referenced by ATExecAlterConstrInheritability(), ATPrepAddPrimaryKey(), dropconstraint_internal(), and QueueNNConstraintValidation().
|
extern |
Definition at line 592 of file pg_constraint.c.
References AccessShareLock, attnum, BTEqualStrategyNumber, extractNotNullColumn(), fb(), GETSTRUCT(), heap_copytuple(), HeapTupleIsValid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AdjustNotNullInheritance(), ATExecAddIdentity(), ATExecDropNotNull(), ATExecSetNotNull(), findNotNullConstraint(), and MergeAttributesIntoExisting().
Definition at line 1376 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, fb(), format_type_be(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), OidIsValid, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by get_object_address(), and rename_constraint_internal().
Definition at line 1435 of file pg_constraint.c.
References AccessShareLock, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, bms_add_member(), BTEqualStrategyNumber, DatumGetArrayTypeP, elog, ERROR, fb(), FirstLowInvalidHeapAttributeNumber, GETSTRUCT(), heap_getattr(), HeapTupleIsValid, i, InvalidOid, ObjectIdGetDatum(), RelationGetDescr, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by check_functional_grouping().
|
extern |
Definition at line 1240 of file pg_constraint.c.
References AccessShareLock, ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, bms_add_member(), BTEqualStrategyNumber, CStringGetDatum(), DatumGetArrayTypeP, elog, ereport, errcode(), errmsg(), ERROR, fb(), FirstLowInvalidHeapAttributeNumber, get_rel_name(), GETSTRUCT(), heap_getattr(), HeapTupleIsValid, i, InvalidOid, ObjectIdGetDatum(), OidIsValid, RelationGetDescr, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by transformOnConflictArbiter().
Definition at line 1183 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, fb(), get_rel_name(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), OidIsValid, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by expandTableLikeClause(), get_object_address_relobject(), rename_constraint_internal(), and transformTableLikeClause().
Definition at line 1329 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, fb(), GETSTRUCT(), InvalidOid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by ATExecAttachPartitionIdx(), AttachPartitionEnsureIndexes(), DefineIndex(), and DetachPartitionFinalize().
| MAKE_SYSCACHE | ( | CONSTROID | , |
| pg_constraint_oid_index | , | ||
| 16 | |||
| ) |
Definition at line 817 of file pg_constraint.c.
References AccessShareLock, BTEqualStrategyNumber, Constraint::conname, CONSTR_NOTNULL, Constraint::contype, Constraint::deferrable, extractNotNullColumn(), fb(), get_attname(), GETSTRUCT(), HeapTupleIsValid, Constraint::initdeferred, Constraint::initially_valid, Constraint::is_enforced, Constraint::is_no_inherit, Constraint::keys, lappend(), list_make1, Constraint::location, makeNode, makeString(), NameStr, NIL, ObjectIdGetDatum(), palloc_object, pstrdup(), ScanKeyInit(), Constraint::skip_validation, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by createTableConstraints(), MergeAttributes(), and transformTableLikeClause().
Definition at line 895 of file pg_constraint.c.
References AccessExclusiveLock, CatalogTupleDelete(), CatalogTupleUpdate(), elog, ERROR, fb(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, NoLock, ObjectIdGetDatum(), OidIsValid, RelationGetRelationName, ReleaseSysCache(), RowExclusiveLock, SearchSysCache1(), SearchSysCacheCopy1, table_close(), table_open(), and WARNING.
Referenced by doDeletion().
Definition at line 988 of file pg_constraint.c.
References CatalogTupleUpdate(), CONSTRAINT_DOMAIN, CONSTRAINT_RELATION, ConstraintNameIsUsed(), elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, fb(), format_type_be(), get_rel_name(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, namestrcpy(), ObjectIdGetDatum(), OidIsValid, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by rename_constraint_internal(), and RenameRelationInternal().
| FormData_pg_constraint |
Definition at line 168 of file pg_constraint.h.