Re: Inheritance of foregn key constraints.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Inheritance of foregn key constraints.
Дата
Msg-id 15558.1395411243@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Inheritance of foregn key constraints.  (Andrzej Mazurkiewicz <andrzej@mazurkiewicz.org>)
Ответы Re: Inheritance of foregn key constraints.  (Andrzej Mazurkiewicz <andrzej@mazurkiewicz.org>)
Список pgsql-hackers
Andrzej Mazurkiewicz <andrzej@mazurkiewicz.org> writes:
> My patch need one change that might be of significance.
> A type of the depencencies (pg_depend) among the FK constraint (pg_constraint) 
> and the corresponding "RI_ConstraintTrigger" triggers has to be changed from 
> DEPENDENCY_INTERNAL to DEPENDENCY_AUTO.

So in other words, somebody could (accidentally or maliciously) break the
constraint by dropping one of its implementation triggers.  I doubt that's
acceptable.

> If this modification is not applied, the detail child table cannot be dropped 
> without prevous dropping the whole FK constraint because the removing 
> operation depend on the FK constraint of its parent table.

Dropping a child table is going to have much larger problems than that,
no?  What about the values in the child table --- don't you risk orphaning
referencing rows?  Or are you only supporting this on the referencing
side?

In any case, it seems like DROP TABLE could remove the dependency entries
for itself, rather than taking the risk of weakening the dependency type.
        regards, tom lane



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

Предыдущее
От: Kohei KaiGai
Дата:
Сообщение: Re: Creating tables for columns
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: QSoC proposal: Rewrite pg_dump and pg_restore