Skip to content

Keep PostgreSQL case-insensitive pattern operators intact - #924

Open
adenzhou1350 wants to merge 1 commit into
andialbrecht:masterfrom
adenzhou1350:codex/postgres-pattern-operators
Open

adenzhou1350 wants to merge 1 commit into
andialbrecht:masterfrom
adenzhou1350:codex/postgres-pattern-operators

Conversation

@adenzhou1350

Copy link
Copy Markdown

Related to #613. Formatting 'a' !~* 'xyz' currently produces 'a' !~ * 'xyz': the lexer emits a comparison followed by a wildcard instead of one operator.

Recognize PostgreSQL's ~*, !~*, ~~* and !~~* as comparison tokens before the generic comparison rule. These are the case-insensitive regular-expression and LIKE operators documented in PostgreSQL's pattern-matching reference. Ordinary multiplication, SELECT wildcards, quoted operator text, and symbols separated by whitespace/comments retain their behavior.

<@ already works on the current base. This is independent of #920's @? repair and does not claim support for every PostgreSQL custom operator or every case in #613.

Validation on Windows / Python 3.14:

  • Identical 17 focused regression/control cases: original source 13 failed, 4 passed; repaired source 17 passed.
  • Full native suite: 523 passed, 2 xfailed, 1 xpassed; the original suite's xfail/xpass outcomes are unchanged.
  • 64 operand/spacing/reindent cases preserve lexical tokens through formatting and are idempotent.
  • Ruff and git diff --check pass.

AI-assisted implementation with independent native reproduction. No PostgreSQL server, cross-platform CI or performance claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant