Skip to main content

Module expr

Module expr 

Source
Expand description

Scalar expression evaluator: turns an Expr into a Value under a row context (column -> value) and a parameter binding.

Modules§

composites
Composite type values through the statement’s catalog: attribute metadata, record_in input and the coercion of rows and records to a composite type.
enums
Enum label input and output, ordered label functions and I/O casts through the statement’s catalog.
variadic_any
Built-ins declared VARIADIC "any": an explicit VARIADIC array argument supplies the variadic values element by element, flattening every dimension, as PostgreSQL’s extract_variadic_args does.

Structs§

CanonicalMultirange
CanonicalRange
CompiledLikePattern
A LIKE/ILIKE pattern compiled once for repeated evaluation. ASCII values use a byte matcher; Unicode retains character-oriented _ semantics and contextual lowercase rules.
DateOrderScope
Restore the calling thread’s date order when the input scope ends.
EvalContext
IntervalFields
The months, days and microseconds of an interval.
TemporalInputContext
A copyable context passed from a statement to its workers.
TemporalInputScope
TransactionClockScope
Enters a transaction start for the current thread until it drops, restoring the clock entered before it. The engine enters its transaction timestamp at every statement boundary, and the parallel executor enters the dispatching thread’s clock on each worker.

Enums§

FloatWidth
IntegerWidth

Traits§

CatalogInputFunctions
Catalog input needed after analysis selects a type for an unknown literal. Domain array input includes each element’s constraints, so the caller must retain this value rather than read the text again at execution.
EngineHook
Engine-side hook that scalar function evaluation calls for stateful sequence and user-defined functions. Query-valued expressions are not accepted here: lowering assigns them physical query-plan slots executed by uqa-execution::ScalarSubqueryRunner.
RowLookup
Read-only row interface used by the expression evaluator. Most callers use a materialised ResultRow, while hot execution paths can expose a projected value slice without rebuilding a string-keyed map for every row.

Functions§

array_dimensions
Return every dimension of a rectangular array value.
array_transform_argument_positions
Map call-order arguments onto the declared array_sort and array_reverse slots. None means the arity or a named argument does not select a catalogued overload.
array_transform_argument_positions_with_control
array_value_to_string
bound_scalar_function_strictness
Return the PostgreSQL 18 strictness contract selected by a structural function binding. Parser-owned syntax and overload-specific built-ins must be classified by FunctionDispatch, never by their diagnostic display label.
builtin_scalar_function_strictness
call_argument_value
Return a call argument’s value expression after stripping named and explicit VARIADIC syntax markers.
cast_value
Cast a value to the named SQL type, mirroring CAST(expr AS ty). Types outside the engine’s coercion surface return SQLError::Unsupported.
cast_value_from
Cast a value while preserving an explicitly declared source type when the runtime carrier erases it. PostgreSQL 18 integer-to-bytea/oid casts and xid cast rejection require the source’s declared identity.
cast_value_from_with_control
cast_value_with_type_resolution
Cast a value after resolving catalog-owned types and enforcing domain constraints before exposing a base-type carrier.
cast_value_with_type_resolution_with_control
Resolve catalog inputs at their external handoff, then admit SQL-owned names, element conversions and output before constructing them.
catalog_output_required
A value whose text is owned by the SQL catalog reached a context-free conversion. Catalog-aware callers render these carriers before delegating here.
clock_timestamp_micros
Read the platform wall clock as Unix microseconds.
coercion_type_name
compare_nullable_with_control
compare_typed_values_with_control
Compare already-bound values, preserving type operator failures and total container NULL semantics. Callers supply top-level NULL placement and must apply operator-selected casts first.
compare_with_control
Compare with the existing two-valued selector convention that SQL UNKNOWN sorts as equal.
core_value_to_json
Enum carriers need catalog label output and are rejected rather than rendered from their storage key.
eval
Evaluate a value-producing AST expression against one row and parameter context.
eval_binary_values
Apply a binary SQL operator to values that have already been evaluated. Execution engines use this when a hot path compiles expression traversal ahead of time but must retain the evaluator’s exact comparison, numeric promotion, NULL, overflow, and division-by-zero semantics.
eval_binary_values_with_control
Evaluate the existing binary operator while owning every value producer and comparison workspace under one allowance.
eval_binary_values_with_integer_width
Evaluate an operator while retaining the integer type selected by SQL operator resolution. The dynamic Value carrier stores all integers as i64, so expression plans pass this width alongside the operands.
eval_binary_values_with_integer_width_with_control
Preserve the selected integer width without separating an allocated result from its owner on errors.
eval_bound_builtin_function_call
Evaluate a call’s argument list, unwrapping name => value
eval_builtin_function_call
Execute a call whose stored binding selects a built-in routine. Dynamic runtime callbacks and SQL routines must not override this stable binding.
eval_comparison_truth
Compare two values without allocating an intermediate Value::Bool. None represents SQL UNKNOWN, including an undecided anonymous row comparison.
eval_comparison_truth_with_control
Evaluate the same three-valued comparison while admitting the native numeric, JSONB and array comparison workspace to the caller’s allowance.
eval_float_arithmetic
Apply arithmetic at its resolved float width before widening the storage carrier.
eval_float_arithmetic_with_control
Evaluate the same width-specific arithmetic with controlled numeric coercion workspace. The resulting float carrier is inline.
eval_function_call
Execute a scalar function after its argument expressions have already been evaluated.
eval_generated_function_call_with_control
Execute a built-in selected by generated-column validation. This boundary has no session, host-function or query callbacks; general runtime dispatch remains with eval_function_call. Argument values arrive already admitted by their producers.
eval_numeric_operator
eval_numeric_operator_with_control
Evaluate the existing selected numeric overload while casts, type names and intermediate values remain owned by the original allowance.
evaluate_call_args
Return the PostgreSQL 18 strictness contract for a built-in scalar call when its implemented overload is known.
format_real
Format a real value using PostgreSQL’s shortest decimal and exponent thresholds.
format_regtype_value
Format a scalar or array OID carrier using the catalog-aware output function of a reg* type. None means the declared type is not one of the supported alias types or the value is SQL NULL.
format_regtype_value_with_control
Retain a resolver’s returned spelling and construct SQL-owned array and fallback text under the invoking allowance.
in_range
in_range(val, base, offset, sub, less) for a non-null val and base of one ordering type and an offset of the type transformFrameOffset selected for it.
integer_width_for_literal
integer_width_for_type
invalid_boolean_input
The error boolin reports for text that is not a boolean.
invalid_numeric_input
The error numeric_in reports for text it cannot read.
json_strip_nulls_argument_positions
Map call-order arguments onto the declared (target, strip_in_arrays DEFAULT false) slots. None means the arity or a named argument does not select either catalogued overload.
multirange_from_ranges
negate_value
Apply PostgreSQL prefix - while retaining the operand’s declared type.
negate_value_with_control
parse_boolean_input
boolin: PostgreSQL’s parse_bool over trimmed text, accepting case-insensitive prefixes of true, false, yes and no, on, at least two letters of off, and 1 and 0.
parse_multirange
parse_pg_array_literal
Parse a PostgreSQL array literal ({1,2,3}, {"a b",NULL}, {{1,2},{3,4}}) into nested lists of string/NULL values; the caller casts elements.
parse_pg_array_literal_with_control
parse_range
parse_uuid_bytes
Parse every UUID input spelling accepted by PostgreSQL into network-order bytes.
quote_ident
Double-quote unless the identifier starts with a lowercase letter or an underscore, holds only lowercase letters, digits and underscores, and is not a keyword other than an unreserved one (quote_identifier).
read_catalog_array_input
Read an array whose elements are domains with the same input and constraint path as a catalog-aware cast. The resolved target preserves domain identity; a scalar outer domain remains the surrounding expression’s runtime coercion.
read_catalog_input
Read a catalog-dependent constant once, retaining its typed datum in stored syntax.
temporal_date_order
transaction_clock_micros
The transaction start entered for the current thread, or None outside any statement.
truthy
Whether a condition holds. NULL does not; text, which reaches a condition only as an unknown literal or parameter, holds when boolin reads it as true (parse analysis rejects any other text); the engine’s numeric retrieval predicates hold when non-zero.
type_comparison_can_fail
Declared SQL keys whose runtime values may require a fallible comparison operator.
unknown_function_error
function name(arg types) does not exist - the error PostgreSQL raises when call resolution fails (SQLSTATE 42883).
validate_json_object_key_type
JSON object keys must be scalar SQL datums, including when an array-shaped catalog vector has a distinct runtime carrier. Each constructor retains its own NULL-key diagnostic.
validate_legacy_vector_comparison
Validate the layout required by the oidvector scalar equality, ordering and hashing operators. Array operators on int2vector permit dimensionless arrays.
validate_named_argument_order
Enforce PostgreSQL function-call ordering before overload resolution. Positional arguments must precede named arguments, and each explicit name may occur only once.
validate_named_argument_order_with_control
value_comparison_can_fail
Whether an opaque value key can suppress a SQL operator failure. A single such input remains legal until an operator compares it.
value_to_json_text
Render an engine value as PostgreSQL JSON input text without losing the lexical representation of values already typed as json or jsonb.
value_to_string
Produce SQL text, including errors from type output functions.
value_to_string_with_control
value_to_tensor
Coerce a Value into a tensor: an array of homogeneous numeric vectors. Used by TENSOR(N) columns to store chunk embeddings for one row while still indexing each vector element.
value_to_tensor_with_control
value_to_text
value_to_text_with_control
value_to_vector
Coerce a Value into a Vec<f32> if it is a homogeneous numeric list (used to read vector literals from ARRAY[...] or $N Vector params).
value_to_vector_with_control
value_type_name
values_equal_nullable_with_control
values_equal_with_control
variadic_argument_value
Return the value expression carried by an explicit VARIADIC marker, including one nested inside a named argument.
vector_value_to_string
PostgreSQL’s legacy vector text format separates values with spaces.
wrap_variadic_argument
Wrap the last actual argument of an explicit VARIADIC invocation while preserving a named-argument marker at the top level.