Skip to main content

Module catalog_fold

Module catalog_fold 

Source
Expand description

Plan-time constant folding for catalog-dependent expressions.

fold_catalog_exprs_in_plan walks a SqlPlan and replaces Cast { expr: Literal(String(s)), to_type: "regclass" } and Cast { expr: Literal(String(s)), to_type: "regtype" } nodes with their resolved OID literals using the SqlCatalog trait. This keeps the data-plane evaluator pure (no catalog/session context) while still supporting the 'name'::regclass / 'name'::regtype PostgreSQL idiom.

Functionsยง

fold_catalog_exprs_in_plan
Walk every Filter in plan and fold catalog-dependent cast expressions to their constant OID equivalents.