Skip to content

Conversation

@guan404ming
Copy link
Member

Why

PostgreSQL allows promoting an existing unique index to a PRIMARY KEY or UNIQUE table constraint via ALTER TABLE, which was
not supported by the parser.

How

  • Add ConstraintUsingIndex variant to TableConstraint with display, span, and serialization support
  • Parse USING INDEX index_name after PRIMARY KEY or UNIQUE keywords in constraint parsing
  • Add tests for named/unnamed constraints and deferrable characteristics

@guan404ming guan404ming marked this pull request as ready for review February 9, 2026 09:54
Signed-off-by: Guan-Ming Chiu <guanmingchiu@gmail.com>
@guan404ming guan404ming force-pushed the pg-primary-key-using-index branch from 3cdaa92 to 91a677f Compare February 12, 2026 01:34
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.

1 participant