Skip to content

fix: parse PostgreSQL ORDER BY ... USING operator (#2925) - #2939

Open
ARAYN7011 wants to merge 1 commit into
JSQLParser:masterfrom
ARAYN7011:fix/postgresql-order-by-using-operator
Open

ARAYN7011 wants to merge 1 commit into
JSQLParser:masterfrom
ARAYN7011:fix/postgresql-order-by-using-operator

Conversation

@ARAYN7011

Copy link
Copy Markdown

Fixes #2925.

PostgreSQL allows ORDER BY expr USING operator (USING < = ASC, USING > = DESC). OrderByElement() now accepts USING followed by a PostgreSQL operator name (reusing PostgreSqlOperatorName()), stores it in OrderByElement.usingOperator, and renders it in toString() and OrderByDeParser.

Test plan:

  • New SelectTest.testPostgreSqlOrderByUsingOperator (parse + deparse round trip incl. window ORDER BY, NULLS combination, multi-char operator); it does not compile/pass without the change.
  • Full ./gradlew test spotlessCheck green locally.

AI assistance: this change was prepared with Claude Code (AI-assisted) and verified by running the test suite.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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.

[BUG] JSQLParser : PostgreSQL : ORDER BY ... USING operator fails to parse

1 participant