Re: rename index?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rename index?
Date: 2001-11-22 02:43:45
Message-ID: 200111220243.fAM2hjl05778@candle.pha.pa.us
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.

We have already forced DROP object to honor the object type, so ALTER
TABLE should do the same, right? Do we need to add an ALTER INDEX
command, and an ALTER SEQUENCE command too? Maybe ALTER NONTABLE? :-)

Added to TODO:

o Prevent ALTER TABLE RENAME from renaming indexes and sequences (?)

We can figure out figure out later how we want to address this.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-11-22 03:10:02 Re: Bug #513: union all changes char(3) column definition
Previous Message Bruce Momjian 2001-11-22 02:28:44 Re: More FK patches