Re: multi column foreign key for implicitly unique columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: multi column foreign key for implicitly unique columns
Дата
Msg-id 4876.1092757094@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: multi column foreign key for implicitly unique columns  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-sql
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> ... It sounds like it'd be a pain at best.

Also, that would directly violate the SQL spec's model of dependencies,
with possibly unpleasant consequences.  The current implementation does
exactly what SQL says to do.  I cite from SQL99 11.99 DROP CONSTRAINT:
        3) If TC is a unique constraint and RC is a referential constraint           whose referenced table is T and
whosereferenced columns are the           unique columns of TC, then RC is said to be dependent on TC.
 
        ...
        6) If RESTRICT is specified, then:
           a) No table constraint shall be dependent on TC.
           NOTE 195 - If CASCADE is specified, then any such dependent           object will be dropped by the
effectiveexecution of the           <alter table statement> specified in the General Rules of this
Subclause.
        regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: multi column foreign key for implicitly unique columns
Следующее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: SELECT MAX(c) FROM (SELECT ... FOR UPDATE) AS foo