Skip to main content

Module definition

Module definition 

Source
Expand description

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§

KeyPartition
A partition below the relation a key is defined on. DefineIndex visits each partition after its parent, siblings in partition bound order.
KeyRelation
The relation a key’s index is built on.

Enums§

IndexOwner
What owns an index, which names the index in an attribute error.
PartitionKeyIndex
How a partition receives a key defined on its ancestor.

Functions§

define_partition_key
A partition with an equivalent key adopts it. For any other partition DefineIndex builds a new index: a primary key must not meet the partition’s own primary key, and the key must hold the partition’s own partition key columns.
index_order
The keys one statement declares, in the order transformIndexConstraints builds their indexes: the primary key first, and a key whose index would repeat an earlier key’s index dropped, giving its name to that key when the earlier key has none.
is_system_column
Whether name is a system column, which every table has beside its own columns.
missing_key_column
column "c" named in key does not exist, for a key or included column that the relation lacks.
multiple_primary_keys
A second primary key, reported with the relation’s own name.
repeated_key_column
A key column named twice in one key.
resolve_system_key_attribute
A system column that is a key attribute needs an operator class of the index’s access method for its type. The transaction and command identifiers of xmin, xmax, cmin and cmax have one only for a hash index, and the tuple identifier of ctid has one for a btree and a hash index; the object identifier of tableoid is ordered wherever integers are.
system_column_index
index creation on system columns is not supported.
validate_index_attribute
DefineIndex builds no index on a system column or on a virtual generated column. columns are the relation’s columns, and a name outside them is a system column, which the index’s attributes have already been resolved to.
validate_key_definition
Validate a key as DefineIndex does before it builds the key’s index on relation: the index’s attributes are resolved in order, key columns before included columns; then a second primary key, the partition key, and each attribute as one an index can hold.
validate_overlaps_column
The WITHOUT OVERLAPS column of a key must be a range or multirange column; a system column never is.
validate_overlaps_key_length
A WITHOUT OVERLAPS key compares at least one column by equality besides its period.