Skip to main content

Module defaults

Module defaults 

Source
Expand description

Column default validation and binding, as cookDefault analyzes a default: the expression is checked for what a default cannot contain, reduced to a constant when it is one, and coerced to the column’s type in assignment context.

Functions§

bind_stored_schema_expression
Bind a copy of stored schema expression syntax and carry its exact routine identities, user-defined type identities and enum constants back into the syntax. typed_expression is the syntax with its column references replaced by typed placeholders.
check_assignable
coerce_to_target_type in assignment context: the expression’s type must have an assignment cast to the column’s type.
cook_constant
Reduce a default that is a constant as parse analysis reduces it: an unknown literal is read by the column type’s input function and stored as a constant of that type, a cast of a literal is read by the cast’s type, and a NULL constant leaves no default. Returns whether a default remains.
validate_default_expression
Analyze a default as cookDefault does and bind it for storage. column names the column, or the domain, the default belongs to. Returns whether the default remains: a default that cooks to a NULL constant is dropped, as AddRelationNewConstraints and DefineDomain store no default for it.