Skip to main content

Module declaration

Module declaration 

Source
Expand description

Bind complete table declarations around their sequence and catalog publication boundaries.

Re-exports§

pub use crate::schema::table_creation::keys::InheritedDefinitions;

Structs§

CreateTableAnalysisContext

Functions§

bind_create_table_partitioning
Bind the partition bound and key of the created relation, which DefineRelation computes once the relation exists.
clone_create_table_parent_keys
The keys a partition clones from its parent, which DefineRelation creates once the table’s own partition key is stored and before its CHECK constraints: each is checked against that partition key and its index named, beside the CHECKs the table inherits. The namer then names the declared keys.
cloned_constraint_names
The names of the constraints a new table holds before its CHECKs besides the ones it inherits: the keys and foreign keys a partition clones from its parent.
define_create_table_constraints
Define every declared key before foreign-key binding so a foreign key can reference its own table’s keys.
define_create_table_defaults
The defaults and generation expressions of the new table’s columns, which DefineRelation transforms in column order before it binds the table’s partitioning, since a partition key may name a generated column; each stored expression takes its pg_attrdef OID as AddRelationNewConstraints stores it.
define_inherited_expressions
heap_create_with_catalog stores what the parents give with the relation, before the statement’s own expressions are analyzed: the inherited defaults and generation expressions in column order, then the inherited CHECK constraints in the order MergeAttributes collected them.
prepare_create_table_declaration
Describe the new table’s columns before its name is claimed: the parents’ columns merge ahead of the local ones as MergeAttributes merges them, the declared primary key’s columns take their NOT NULL constraints, BuildDescForRelation requires USAGE on every column’s type, and CheckAttributeNamesTypes rejects system column names and pseudo-types.
transform_create_table
Examine the statement’s elements in written order as transformCreateStmt does while it analyzes the statement, before the relation’s name is checked: each column’s type and then its clauses, and each NOT NULL table constraint; then validate the declared keys.