Re: rename index? - Mailing list pgsql-hackers

From mlw
Subject Re: rename index?
Date
Msg-id 3BF058F2.81828268@mohawksoft.com
Whole thread Raw
In response to rename index?  (mlw <markw@mohawksoft.com>)
Responses Re: rename index?
List pgsql-hackers
Tom Lane wrote:
> 
> ALTER TABLE RENAME works on indexes (at least in recent releases).
> 
>                         regards, tom lane

OH, stupid me, I didn't get what you meant. Treat the index name as the table
name, i.e.

alter table fubar_idx rename to fubar_idx_old;

Yes, that works, but I would never have guessed that. Is that what Postgres
should be doing?

Might not it be useful to have an "alter Object ..." which will work on
Postgres objects, like sequences, functions, etc. to make general changes.
Using alter table to rename an index seems a bit arcane.


pgsql-hackers by date:

Previous
From: Brent Verner
Date:
Subject: Re: rename index?
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Regression test database still stuffed