Skip to content

Clarify PostgreSQL DO support and verify the reported block - #2633

Merged
manticore-projects merged 2 commits into
JSQLParser:masterfrom
minleejae:docs/postgresql-do-issue1946
Sep 13, 2026
Merged

manticore-projects merged 2 commits into
JSQLParser:masterfrom
minleejae:docs/postgresql-do-issue1946

Conversation

@minleejae

@minleejae minleejae commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

PostgreSQL DO statements are already accepted with Dialect.POSTGRESQL, but the unsupported-grammar guide still labels them unsupported. Correct the procedural-support description and add a usage example showing the required dialect and access to the preserved body literal.

Replace the simplified regression with the full SQL reported in the issue. Verify exact body preservation, including nested SQL, non-ASCII strings and internal semicolons, while statements before and after the block remain separate. Check deparser output and reparsing with unsupported-statement fallback disabled. Include the fixture's standard license header and compare the emitted statement independently of leading comments, so Gradle and Maven exercise the same input.

The body remains an opaque StringValue; parsing or validating its internal procedural statements is deferred. This follows the PostgreSQL DO syntax, which takes a string literal and allows LANGUAGE before or after it. The reported END $$; is valid: the outermost PL/pgSQL END does not require a semicolon. No production parser or AST code changes are needed for this scope.

Closes #1946.

Validation:

  • Java 17 ./gradlew check: passed, 6,904 tests, 0 failures/errors, 25 skipped.
  • Java 17 mvn --batch-mode --no-transfer-progress verify: passed, 6,886 tests, 0 failures/errors, 25 skipped.
  • PostgreSQL 17.11: executed 11 cases both as original input and after JSqlParser deparsing, including both documentation examples, language placement, quoted/escaped/tagged bodies and the full issue SQL. For the issue SQL, created a minimal schema, verified the inserted values, and executed it again to check the already-present branch. The isolated server was stopped afterward.
  • Sphinx HTML: builds successfully with no new warnings compared with master; the PostgreSQL example's highlighting warning is removed.

@manticore-projects
manticore-projects merged commit 02b9d94 into JSQLParser:master Sep 13, 2026
10 checks passed
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.

[Feature] Prostgres Procedural DO $$BEGIN ... END$$

2 participants