Re: Dropping column silently kills multi-coumn index (was

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Justin Clift <justin(at)postgresql(dot)org>
Cc: Glen Parker <glenebob(at)nwlink(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Dropping column silently kills multi-coumn index (was
Date: 2003-02-15 18:21:32
Message-ID: 200302151821.h1FILW128263@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Justin Clift wrote:
> Bruce Momjian wrote:
> > The issue here is whether dropping a column should automatically drop a
> > multi-column index of which that column is a member.
> >
> > The example shown below is particularly good because the dropped field
> > is second in the index, meaning that the index is useful for lookups on
> > field1 alone, so dropping field2 removes a useful index on field1. I
> > don't think it is defensible to allow DROP COLUMN to remove the index.
> > Instead, I think we have to refuse the DROP COLUMN and require the user
> > to drop the index and recreate it just on field1 if desired. I don't
> > think CASCASE enters into this because of the effect on field1.
> >
> > Comments?
>
> Would it be possible/practical to have PostgreSQL recreate the
> multi-column index, but without the dropped column?

Yes, we could, but creating an index takes time, so is probably
something we would want the admin to do manually.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-02-15 18:29:55 Re: Dropping column silently kills multi-coumn index (was
Previous Message Greg Stark 2003-02-15 17:28:10 Re: Why must SELECT DISTINCT, ORDER BY expressions must appear in target list?