Fix ALTER INDEX RENAME so that if the index belongs to a unique or primary key
Tom Lane <tgl@sss.pgh.pa.us>
Fix ALTER INDEX RENAME so that if the index belongs to a unique or primary key constraint, the constraint is renamed as well. This avoids inconsistent situations that could confuse pg_dump (not to mention humans). We might at some point provide ALTER TABLE RENAME CONSTRAINT as a more general solution, but there seems no reason not to allow doing it this way too. Per bug #3854 and related discussions.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_constraint.c | modified | +63 −1 |
| src/backend/commands/tablecmds.c | modified | +14 −3 |
| src/include/catalog/pg_constraint.h | modified | +2 −1 |