Skip to content

Support PostgreSQL parenthesized EXPLAIN options - #2558

Open
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/postgresql-explain-options
Open

Support PostgreSQL parenthesized EXPLAIN options#2558
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/postgresql-explain-options

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Fixes #1416

Changes

  • Parse PostgreSQL's parenthesized EXPLAIN options, including FORMAT TEXT, numeric booleans, and the options documented through PostgreSQL 18.
  • Preserve parentheses, option order, and repeated options in an ordered AST. Keep the existing map/getOption/addOption APIs available with their last-value behavior.
  • Share option rendering between the AST and StatementDeParser, and preserve nested statement visitor traversal.
  • Validate PostgreSQL option syntax when parentheses are used or the PostgreSQL dialect is selected. Leave the existing permissive unparenthesized syntax available in default/other dialect modes.

This PR concerns EXPLAIN options; it does not add new kinds of explainable statements or enforce server-side execution restrictions between options.

Verification

  • Full Gradle check (tests, Checkstyle, PMD, Spotless).
  • Maven clean verify with Java 17.
  • Regression tests for CTEs, DML, VALUES, repeated options, malformed syntax, legacy APIs, and other dialect forms.

Reference: PostgreSQL 18 EXPLAIN.

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.

Postgres EXPLAIN parsing incorrect and missing new flags

1 participant