Expand description
Static SQL type propagation and PostgreSQL-compatible common-type rules.
Re-exports§
pub use common::common_context_expression_type;pub use common::common_type;pub use common::common_type_in;pub use common::select_common_input_type;pub use common::values_column_types;pub use common::CommonTypeContext;
Modules§
- composite_
rows - Store typed ROW constructors with attribute positions chosen by their original analysis.
Structs§
- Builtin
Function Overload - Cast
Catalog Entry - Matched
Routine Signature - A fully matched call signature. Declared identity is kept separate from expansion-aware call binding.
- Resolved
Function Overload - Routine
Call Descriptor - Call-site information that is independent from the routine’s declared identity.
- Routine
Coercion Target - One supplied argument’s concrete coercion destination.
- Routine
Parameter Descriptor - One declared input or output parameter participating in routine-call matching.
- Routine
Type Substitutions - Concrete substitutions shared by input, return, and output pseudo-types.
Enums§
- Cast
Method - A
PostgreSQLcast’s implementation, separate from its value conversion. - Common
Type Context - The construct selecting a common type, as
select_common_typeandcoerce_to_common_typename it in their diagnostics. - Routine
Polymorphic Family - Routine
Polymorphic Type PostgreSQL’s supported polymorphic pseudo-type spellings.- Routine
Signature Match Error - A structural or polymorphic-resolution error that must be distinguished from an ordinary non-matching candidate.
- Routine
Variadic Mode - Routine
Variadic Plan - Execution plan for the declared variadic array parameter.
Traits§
Functions§
- ambiguous_
binary_ operator oper_select_candidatefound more than one candidate for the operand types, as'1' + '2'does among the arithmetic operators.- ambiguous_
prefix_ operator oper_select_candidatefound more than one candidate for a prefix operator’s operand, as-'1'does among the numeric and interval negations.- assignment_
source_ type - The type of an assignment’s source before coercion to its destination. A bare string or NULL literal has none:
transformAssignedExprandtransformAssignmentIndirectionconvert it with the destination type’s input function instead of checking a source type, so'7'assigns to an integer array element and'abc'fails as integer input. - assignment_
type_ compatible - Whether
PostgreSQLassignment coercion accepts the declared source and target. Domains use their base type for cast selection and retain constraint checking at the value conversion boundary; array coercion applies element by element. - bind_
type_ introspection - Bind polymorphic type-introspection calls and common-type coercions while the input schema still carries declared SQL types.
- bind_
type_ introspection_ with_ control - Bind an admitted scalar tree while every new type name, cast and selected-call allocation remains under the original tree’s allowance and both cancellation scopes.
- bind_
type_ introspection_ with_ resolver - Bind type-introspection calls with access to catalog-backed function and aggregate overloads.
- builtin_
function_ argument_ targets - Return the declared argument targets selected by PostgreSQL-compatible built-in resolution. Known argument types are retained for polymorphic calls, while fixed signatures and overloaded operators supply the context needed to resolve
unknownarguments. - builtin_
function_ type - builtin_
function_ type_ with_ resolver - Type a built-in call whose arguments may name catalog types, such as casts to domains and enums.
- cast_
catalog_ entry - Return the same cast identity used by static coercion compatibility.
- cast_
volatility - Volatility of evaluating
source::targetat run time. A literal of unknown type is converted during parse analysis instead and adds no run-time call. - catalog_
input_ type - Whether a type’s input function consults the catalog: the OID alias types and
aclitemlook names up, and an enum, a composite type, a record or a type known by name is read through its catalog definition. Analysis without the catalog leaves such a literal in the cast form that binding or evaluation reads, and reads every other literal with the type’s input function. - coerce_
common_ context_ value - common_
context_ expression_ type - Resolve an expression participating in
PostgreSQL’s common-type selection. Bare string and NULL literals retain the parser’sunknowntype until the surrounding VALUES, set operation, CASE, or array context selects a concrete type. - common_
context_ type_ with_ control - Preserve unknown-literal and domain rules when selecting an operator’s common type without a catalog callback.
- common_
type - common_
type_ in - The common type of
leftandrightfor the constructcontext, which reports a conflict asselect_common_typeandcoerce_to_common_typereport it:42804when the types are of different categories and42846when the other type has no implicit cast to the selected one. - contains_
unknown_ literal - Whether an expression has an
unknownliteral outside its subqueries, the only nodes that binding converts to enum constants. - equality_
operand_ type - equality_
operand_ type_ with_ control - Preserve the existing equality coercion rules while retaining any copied type payload under the caller’s allowance.
- explicit_
type_ compatible - Whether an explicit SQL cast has a
PostgreSQLcoercion path, independently of its value. NULL input does not make an otherwise missing cast valid. - fold_
stored_ enum_ constants - Replace every
unknownliteral that binding coerces to an enum, an enum array or a domain over one by the constant binding produced for it. Returns whether any literal changed. - foreign_
key_ operand_ type - Resolve the comparison type accepted by a
PostgreSQLforeign key. The referenced key’s operator class makes compatibility directional: an implicit cast from the referencing type to the referenced type is valid, while the reverse cast alone is not. Integer widths, floating widths, character strings, and date/timestamp types additionally have cross-type equality operators in their shared operator families. - is_
unknown_ literal - A bare string or NULL literal, which
PostgreSQLtypes asunknownuntil its context resolves it. - match_
routine_ signature - Match one selected signature and require its defaults to have consistent types.
- range_
frame_ offset_ type - The type a
RANGEframe offset of typeoffset(Nonefor anunknownliteral or parameter) is coerced to when the frame is ordered by a column of typeorder(Nonewhen the key is itselfunknown, which sorts astext). An offset of the exact type of one support function selects it; anunknownoffset prefers the ordering type; any other offset must coerce implicitly to exactly one support function’s type. - resolve_
alter_ column_ type - Resolve an ALTER declaration after its relation and column checks. The compiler keeps modifier syntax intact until this boundary, including declarations an
IF NOT EXISTSaction can skip. - resolve_
declared_ column_ type - routine_
polymorphic_ type - Parse a routine pseudo-type after applying the same spelling normalization as routine identity matching.
- scalar_
cast_ source_ type_ name_ with_ control - Casts retain a source domain’s identity so an identity cast cannot re-run its constraints. Operator consumers continue to use the underlying type.
- scalar_
integer_ operation_ width - scalar_
integer_ operation_ width_ with_ control - Select the existing arithmetic width from borrowed IR and schema metadata without constructing an untracked inferred type or name.
- scalar_
operand_ type_ name - scalar_
operand_ type_ name_ with_ control - Preserve explicit binding and domain precedence while admitting inferred types and their emitted names. Optional semantic inference failures remain absent; resource failures propagate to the original caller.
- scalar_
record_ field_ type_ with_ control - Retain a ROW field’s analyzed SQL identity before its scalar carrier erases widths and typed NULLs. Only syntax that
PostgreSQLleaves unknown receives the unknown OID. - scalar_
type - scalar_
type_ with_ control - Infer a scalar type from borrowed schema and parameter metadata while retaining every constructed type and temporary buffer under the supplied allowance.
- scalar_
type_ with_ resolver - select_
common_ input_ type select_common_input_type_with_controlwithout production limits.- store_
operand_ coercions - Store the conversions selected for operator operands, function arguments and CASE result arms, as
PostgreSQLstores analyzed casts and typed constants. Each operand keeps its operator’s declared input type, including numeric conversions, array coercions and domain-to-base relabels. Runtime annotations of an unchanged carrier type do not become stored SQL casts. Catalog input constants keep their cast for identity binding; other unknown literals retain the selected input function’s typed value. Returns whether anything changed. - stored_
enum_ constant - The stored form of an enum constant: its label-identity value under the type’s OID identity. The type is resolved from the identity when the expression is bound, so no cached name can go stale.
- undefined_
binary_ operator operator does not existfor a binary operator;Noneis an operand of typeunknown.- undefined_
binary_ operator_ named undefined_binary_operatorwith operand type names already spelled.- undefined_
prefix_ operator operator does not existfor a prefix operator.- validate_
catalog_ literals - Convert the
unknownliterals that binding coerces to catalog enum types, reporting the first invalid input asPostgreSQLparse analysis does. Binding at execution then folds the same literals without failing. - values_
column_ types