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§
- Foreign
NotNull Context - The namespace and CHECK constraints already held when a foreign table’s NOT NULL constraints are stored.
- Inherited
NotNull - 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
tableasAddRelationNotNullConstraintsdoes, after its CHECK constraints: the declared constraints take their names and OIDs in declaration order, then the constraints only parents give.relation_oidis the relation’s OID, which thepg_constraint_conrelid_contypid_conname_indexviolation of a given name the relation holds reports.