Support ALTER INDEX ... RENAME TO - #3156
Conversation
Fixes #3121, required by Django migrations. ALTER INDEX ... RENAME TO previously returned a not-yet-supported error from the AST conversion layer. It now converts to a new RenameIndex plan node that resolves which table owns the index (searching the explicitly named schema, or the schemas on the search path, since Postgres names indexes without naming their table) and renames it via the engine's IndexAlterableTable interface. Also corrects the statement's command tag from the CockroachDB-style RENAME INDEX to Postgres's ALTER INDEX, and upgrades the generated command-docs tests for the statement from Parses to Converts.
|
|
SummaryThe change is broadly covered across successful index renames, name and schema resolution, search-path behavior, missing or conflicting names, rollback and commit handling, client-visible results, query continuity, and preservation of uniqueness rules. Edge-case and concurrent-use scenarios were also examined, with the observed cross-table naming limitation matching the intended behavior. Safe to merge — no PR-attributable regressions or new failures were identified, and the exercised rename, error-handling, transaction, constraint, and resolution behaviors are healthy. The observed concurrency limitation is documented and intentional, so it is a flag for later rather than a merge blocker. Tests run by Ito
Tip Reply with @itoqa to send us feedback on this test run. |
|
@zachmu DOLT
|

Adds support for ALTER INDEX ... RENAME TO.
Fixes #3121.