cascading column drop to index predicates - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject cascading column drop to index predicates
Date
Msg-id 3FE68D87.6040200@familyhealth.com.au
Whole thread Raw
Responses Re: cascading column drop to index predicates
List pgsql-hackers
Hey Tom,

With regards to our previous conversation about dropping columns now 
properly dropping indexes that contain predicates that reference that 
column,  I now find it a bit disconcerting that such indexes are 
automatically removed when the column is dropped, instead of requiring a 
CASCADE.

The thing is, if you drop a column that is used in a normal index, yes 
the index is now useless - drop it.

However, since you can have (and I have) indexes like this:

CREATE INDEX asdf ON table (a, b, c) WHERE d IS NOT NULL;

If I drop column d, there is no way I want that index to just disappear!

This has already caught me out...

Can we change it to requiring a CASCADE?  Is that a good idea?

Chris



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: What to do with my patch?
Next
From: Tom Lane
Date:
Subject: Re: cascading column drop to index predicates