Skip to content

Support PostgreSQL CREATE INDEX header variants - #2527

Open
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:feat/postgresql-create-index-header-2524
Open

Support PostgreSQL CREATE INDEX header variants#2527
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:feat/postgresql-create-index-header-2524

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

What

  • Parse PostgreSQL CREATE INDEX CONCURRENTLY.
  • Allow the PostgreSQL index name to be omitted.
  • Parse ON ONLY table_name.
  • Expose concurrently and only as explicit CreateIndex properties.
  • Preserve all variants in both CreateIndex.toString() and CreateIndexDeParser.

Why

These server-valid PostgreSQL header forms currently fail before the index key is reached. They are part of the documented PostgreSQL 18 CREATE INDEX grammar: https://www.postgresql.org/docs/18/sql-createindex.html

Testing

  • ./gradlew check --no-daemon --no-build-cache -Dorg.gradle.vfs.watch=false
  • Added three parser/deparser and AST tests in PostgreSQLCreateIndexTest.
  • Executed the same three statements successfully on PostgreSQL 18.6, including the concurrent build outside a transaction block.

Fixes #2524. The separate key and trailing-clause scope remains in #2525.

AI assistance

OpenAI Codex was used to audit the grammar, draft the implementation, and run validation. The changes and tests were reviewed against the PostgreSQL 18 documentation and a PostgreSQL 18.6 server.

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] 5.4-SNAPSHOT: PostgreSQL CREATE INDEX header variants fail to parse

1 participant