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

From Andreas Pflug
Subject Re: cascading column drop to index predicates
Date
Msg-id 3FE7193C.1000703@pse-consulting.de
Whole thread Raw
In response to Re: cascading column drop to index predicates  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

>Rod Taylor <pg@rbt.ca> writes:
>  
>
>>I think Andreas is trying to argue that if you drop column b from index
>>(a, b) that the index should be converted into index(a) -- assuming of
>>course there isn't already an index(a).
>>    
>>
>
>That seems to be well outside the charter of DROP CASCADE.  I think we
>either drop or don't drop; we don't go building new indexes, which is
>what this would take.  There are also definitional problems --- for
>instance, if the index is UNIQUE, does it transmogrify into a UNIQUE
>constraint on A alone (which would most likely fail)?
>  
>

Agreed, auto creation wouldn't be necessary/expected. If you drop, 
objects disappear, you don't expect them to morph. But I'd like to be 
inhibited to drop the column if it requires a somewhat recreated index 
on (a). So IMHO a DROP INDEX [RESTRICT] should drop only dependent 
objects if this won't affect others.

Regards,
Andreas




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: cascading column drop to index predicates
Next
From: Claudia D'amato
Date:
Subject: Postgres respond after toomany times to a query view