Firing Order For Referential Integrity Delete

Поиск
Список
Период
Сортировка
От cnliou9@fastmail.fm (CN)
Тема Firing Order For Referential Integrity Delete
Дата
Msg-id 8566aead.0211240520.400f1885@posting.google.com
обсуждение исходный текст
Список pgsql-general
Hi!

Is it guaranteed or not to delete the rows from referencing table
before referenced table when referential integrity constraint is
applied? For example:

CREATE TABLE MasterTable (mc1 TEXT PRIMARY KEY, mc2 int);

CREATE TABLE DetailTable (
dc1 TEXT
,dc2 TEXT
,PRIMARY KEY (dc1,dc2)
,CONSTRAINT MyConstraint FOREIGN KEY (dc1) REFERENCES MasterTable
(mc1)
);

Will the rows in DetailTable be deleted before that in MasterTable
having the same value in mc1 as dc1?

If the answer is negative, then my next question would be:
"Is there any plan to implement this feature?"

Thank you in advance for any instruction!

CN

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

Предыдущее
От: Andrew Hill
Дата:
Сообщение: postgresql slow down
Следующее
От: "Gordon P. Oliver"
Дата:
Сообщение: FATAL 1: Memory exhausted in AllocSetAlloc()