Re: multi column foreign key for implicitly unique columns

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: multi column foreign key for implicitly unique columns
Дата
Msg-id 4123837C.30408@Yahoo.com
обсуждение исходный текст
Ответ на Re: multi column foreign key for implicitly unique columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: multi column foreign key for implicitly unique columns  (Rod Taylor <pg@rbt.ca>)
Re: multi column foreign key for implicitly unique columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
On 8/18/2004 12:18 PM, Tom Lane wrote:

> Richard Huxton <dev@archonet.com> writes:
>> * Allow multiple unique constraints to share an index where one is a 
>> superset of the others' columns.
> 
>> That way you can mark it unique without having the overhead of multiple 
>> indexes.
> 
> That just moves the uncertain-dependency problem over one spot, ie, it's
> the fabricated unique constraint that you can't pin down the
> requirements for.

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    *
ifthat 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.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: multi column foreign key for implicitly unique columns
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: multi column foreign key for implicitly unique columns