resolution order for foreign key actions?

Поиск
Список
Период
Сортировка
От Karl Czajkowski
Тема resolution order for foreign key actions?
Дата
Msg-id 20161108200847.GA22642@moraine.isi.edu
обсуждение исходный текст
Ответы Re: resolution order for foreign key actions?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Hi,

Is there a formal definition for the order in which constraint actions
(i.e. the ON DELETE or ON UPDATE rules) are applied when there are
multiple overlapping/relevant constraints?

I have struggled to find an answer in the manual, but my experiments
suggest that they are interpreted in the order in which the
constraints were defined and the first rule in this order is applied
while subsequent rules are ignored.  This can be very confusing if one
rule says CASCADE and another NO ACTION, and you need to understand
this order of definition to know whether a delete will cascade or
raise an error.

Is there a definitive way to introspect the informatation_schema or
pg_catalog to determine which behaviors will effectively apply to a
given "DELETE FROM ..." or "UPDATE ..." statement?

Thanks,


Karl



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

Предыдущее
От: Ryan Mahoney
Дата:
Сообщение: Running on Docker, AWS with Data Stored on EBS
Следующее
От: Moreno Andreo
Дата:
Сообщение: Best practices to manage custom statistics