Firing Order For Referential Integrity Delete - Mailing list pgsql-general

From cnliou9@fastmail.fm (CN)
Subject Firing Order For Referential Integrity Delete
Date
Msg-id 8566aead.0211240520.400f1885@posting.google.com
Whole thread Raw
List 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 by date:

Previous
From: Andrew Hill
Date:
Subject: postgresql slow down
Next
From: "Gordon P. Oliver"
Date:
Subject: FATAL 1: Memory exhausted in AllocSetAlloc()