Re: multi column foreign key for implicitly unique columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: multi column foreign key for implicitly unique columns
Дата
Msg-id 1803.1092847586@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: multi column foreign key for implicitly unique columns  (Jan Wieck <JanWieck@Yahoo.com>)
Ответы Re: multi column foreign key for implicitly unique columns  (Richard Huxton <dev@archonet.com>)
Re: multi column foreign key for implicitly unique columns  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-sql
Jan Wieck <JanWieck@Yahoo.com> writes:
> If we allow for a unique index, that
>      * it is NOT maintained (no index tuples in there)
>      * depends on another index that has a subset of columns
>      * if that subset-index is dropped, the index becomes maintained
> then the uncertainty is gone. At the time someone drops the other 
> constraint or unique index, the data is unique with respect to the 
> superset of columns. So building the unique index data at that time will 
> succeed.

My goodness this is getting ugly.  The notion of having to invoke an
index build as a side-effect of a DROP sounds like a recipe for trouble.
(Sample problem: what you're actually trying to do is drop the entire
table ... but because the subset-index happens to get visited first,
you go off and build the superset-index before you let the DROP finish.
User will be unhappy, if table is large.  Or try this one: the superset-
index build actually fails because you've already dropped something it
depends on.  This seems quite possible in cases involving cascading from
a drop of an individual column or datatype, for instance.)

I'd like to see more than one person needing it, before we go to that
kind of trouble to do something that's not in the spec.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: multi column foreign key for implicitly unique columns
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: SQL Challenge: Arbitrary Cross-tab