-
Notifications
You must be signed in to change notification settings - Fork 681
Open
Description
The parser fails to parse the PostgreSQL-specific PRIMARY KEY USING INDEX index_name syntax in ALTER TABLE statements:
ALTER TABLE version_downloads
ADD CONSTRAINT version_downloads_pkey PRIMARY KEY USING INDEX version_downloads_unique;Expected: a list of columns in parentheses, found: INDEX
Expected behavior
This is valid PostgreSQL syntax per the ALTER TABLE documentation. The grammar allows:
ADD table_constraint_using_index
Where table_constraint_using_index can be:
[ CONSTRAINT constraint_name ]
{ UNIQUE | PRIMARY KEY } USING INDEX index_name
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
Note that PRIMARY KEY USING INDEX index_name is a distinct form that does not require a column list - it promotes an existing unique index to be the primary key constraint.
Metadata
Metadata
Assignees
Labels
No labels