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

From Tom Lane
Subject Re: cascading column drop to index predicates
Date
Msg-id 16313.1072108544@sss.pgh.pa.us
Whole thread Raw
In response to Re: cascading column drop to index predicates  (Andreas Pflug <pgadmin@pse-consulting.de>)
Responses Re: cascading column drop to index predicates  (Rod Taylor <pg@rbt.ca>)
List pgsql-hackers
Andreas Pflug <pgadmin@pse-consulting.de> writes:
> In that sample mentioned the index might be used mostly with a,b 
> columns. Dropping the index silently might damage the application 
> because it relies on an (a,b) index to be present. IMHO only Indexes 
> that span that single column should be dropped without CASCADE.

That argument makes no sense to me at all.  If you drop the *column*
a or b, and do not thereby break your application, how is the
disappearance of the index on it going to break anything?  The index
is meaningless without something to index.

I think the question at hand is whether the same logic applies to
partial indexes: if the index's condition is no longer meaningful, is
the index meaningful?  I think we can handle both cases the same way.
But clearly an index condition isn't quite the same thing as an index
column, so maybe someone can make a good argument for treating them
differently.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: cascading column drop to index predicates
Next
From: Rod Taylor
Date:
Subject: Re: cascading column drop to index predicates