Expand description
Build NormalizedExpr values from pg_query AST nodes.
Phase-2 scope (per docs/superpowers/plans/phase-2-parser.md):
- Strip redundant casts to a column’s own type.
42::integerfor an integer column collapses to42;'foo'::textfor a text column collapses to'foo'. - Lowercase reserved keywords on the canonical text emitted by
pg_query’s deparser. - Compute the BLAKE3 hash of the canonical text.
Deferred to follow-up phase-2 issues (only affect equivalence sensitivity, not correctness — equivalent inputs that exercise these may diff for now):
- Paren folding (collapsing trivial nested
A_Exprparens). - Sorting commutative operands of
+,*,AND,OR.
Functions§
- from_
pg_ node - Build a
NormalizedExprfrom apg_queryexpression node.