Re: rename index?

From: mlw <markw(at)mohawksoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rename index?
Date: 2001-11-12 23:19:14
Message-ID: 3BF058F2.81828268@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-11-13 01:38:46 Re: ALTER TABLE ADD COLUMN can't use NOT NULL?
Previous Message charles 2001-11-12 22:51:24 pg locking problem