Skip to main content

Module not_nulls

Module not_nulls 

Source
Expand description

The NOT NULL constraints of a new table, which AddRelationNotNullConstraints creates once the table’s CHECK constraints exist. The declared constraints come first, in the order transformCreateStmt collected them, one constraint per column: a later declaration of a column must agree with the earlier one on NO INHERIT and may name the constraint the earlier one left unnamed. A declaration names a column of the relation, a NO INHERIT declaration cannot stand on a column whose parents give a constraint, a given name is new among the relation’s constraints, and a chosen name follows ChooseConstraintName. The constraints only parents give follow, each keeping its first parent’s name unless the relation holds it already.

Structs§

ForeignNotNullContext
The namespace and CHECK constraints already held when a foreign table’s NOT NULL constraints are stored.
InheritedNotNull
A NOT NULL constraint the parents give a column: the first parent’s constraint name and how many parents give it.

Functions§

define_foreign_not_null_constraints
Store foreign-table declarations with the same target, merge, name and identity rules as ordinary tables. Foreign tables have no inherited constraints or supported keys.
define_not_null_constraints
Create the NOT NULL constraints of table as AddRelationNotNullConstraints does, after its CHECK constraints: the declared constraints take their names and OIDs in declaration order, then the constraints only parents give. relation_oid is the relation’s OID, which the pg_constraint_conrelid_contypid_conname_index violation of a given name the relation holds reports.