From: Tom Lane <tgl@sss.pgh.pa.us>
To: George Woodring <george.woodring@iglass.net>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: foreign key on delete cascade order?
Date: Thu, 10 Mar 2022 10:56:43 -0500
Message-ID: <649664.1646927803@sss.pgh.pa.us> (raw)
In-Reply-To: <CACi+J=Tu3O-YAkjtJ=4qYHzrkF2sZv1HNkW7BpaUhmCReXzN1g@mail.gmail.com>
References: <CACi+J=Tu3O-YAkjtJ=4qYHzrkF2sZv1HNkW7BpaUhmCReXzN1g@mail.gmail.com>
George Woodring <george.woodring@iglass.net> writes:
> When using FOREIGN KEY ON DELETE CASCADE, is there an order the entries are
> being deleted?
No, there's no particular attempt to order the deletions. Each cascaded
delete ought to be removing a disjoint set of rows in the referencing
table, so I'm not quite sure why order should matter.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, george.woodring@iglass.net
Subject: Re: foreign key on delete cascade order?
In-Reply-To: <649664.1646927803@sss.pgh.pa.us>
References: <CACi+J=Tu3O-YAkjtJ=4qYHzrkF2sZv1HNkW7BpaUhmCReXzN1g@mail.gmail.com> <649664.1646927803@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox