Firing Order For Referential Integrity Delete

From: cnliou9(at)fastmail(dot)fm (CN)
To: pgsql-general(at)postgresql(dot)org
Subject: Firing Order For Referential Integrity Delete
Date: 2002-11-24 13:20:18
Message-ID: 8566aead.0211240520.400f1885@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Crercio O. Silva 2002-11-24 15:19:55 Re: GUI for Postgres Management? PostgreSQL vs MySQL.
Previous Message Frank Bax 2002-11-24 13:13:36 Re: test against regexp in database