Skip to main content

Module keys

Module keys 

Source
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’s transformIndexConstraint and DefineIndex apply them.

Structs§

AddedKeyRelation
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 transformIndexConstraints transforms 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 transformIndexConstraint checks it, a primary key’s columns as the NOT NULL constraints that ATPrepAddPrimaryKey adds before the index, and then the checks of DefineIndex, which resolves the key’s columns.