Expand description
Declaration and identity rules for newly added PRIMARY KEY and UNIQUE constraints.
Modules§
- definition
- The checks of a PRIMARY KEY or UNIQUE constraint’s declaration and of its index, in the order
PostgreSQL’stransformIndexConstraintandDefineIndexapply them.
Structs§
- Added
KeyRelation - The relation that ALTER TABLE adds a key to.
Functions§
- apply_
primary_ key_ columns - Apply the NOT NULL requirement of a primary key to the stored column candidate.
- transform_
column_ keys - The keys that ALTER TABLE ADD COLUMN declares on the new column, transformed as
transformIndexConstraintstransforms the statement: a second primary key fails with the relation’s name as written, and a key repeating an earlier key’s index is dropped. - validate_
added_ key - Validate a key that ALTER TABLE adds, before its index is named: its declaration as
transformIndexConstraintchecks it, a primary key’s columns as the NOT NULL constraints thatATPrepAddPrimaryKeyadds before the index, and then the checks ofDefineIndex, which resolves the key’s columns.