foreign key on delete cascade order?

From: George Woodring <george(dot)woodring(at)iglass(dot)net>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: foreign key on delete cascade order?
Date: 2022-03-10 15:44:40
Message-ID: CACi+J=Tu3O-YAkjtJ=4qYHzrkF2sZv1HNkW7BpaUhmCReXzN1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When using FOREIGN KEY ON DELETE CASCADE, is there an order the entries are
being deleted?

We are seeing intermittent deadlocks with trying to update a table with the
foreign key entry being deleted.

We have 4 levels of tables chained by foreign keys.

machine -> point -> poll -> status

The status is the only one updated constantly and we are trying to figure
out how to order the update to avoid the deadlock when the machine is
deleted.

Thanks for your help
George
iGLASS Networks
www.iglass.net

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-03-10 15:56:43 Re: foreign key on delete cascade order?
Previous Message Tom Lane 2022-03-10 15:00:18 Re: PQresultMemorySize of ResultSet larger than expected