Skip to content

[BUG] 5.4-SNAPSHOT: PostgreSQL CREATE INDEX header variants fail to parse #2524

Description

@minleejae

Failing SQL feature

PostgreSQL CREATE INDEX header variants are rejected:

  • CONCURRENTLY between INDEX and the index name;
  • an omitted index name;
  • ON ONLY table_name.

SQL examples

CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS pg_idx_email
    ON pg_index_test USING btree (email);

CREATE INDEX ON ONLY pg_index_test USING btree (id DESC);

Actual behavior

Tested with JSqlParser 5.4-SNAPSHOT at 9a32ff568f580178d9a27b101596aa43eb45d0b7:

  • The first statement treats CONCURRENTLY as the index name and fails at IF.
  • The second requires an index name and fails at ON.

Expected behavior

Both statements should return CreateIndex, deparse losslessly, and expose concurrently, only, and the optional index name as structured properties rather than tail strings.

Software information and server validation

This issue is limited to the command header. Index key and trailing clauses are tracked separately.

AI assistance

OpenAI Codex was used to assemble and execute the parser/server comparison. The cases were checked against the PostgreSQL 18 documentation and an actual PostgreSQL 18.6 server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions