pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 12:38:27 -0500
Message-ID: <658814.1646933907@sss.pgh.pa.us> (raw)
In-Reply-To: <CACi+J=T4C9CRs00=NZhSxpsNhQ+cKgFZHJ2U_Mjrd6p_HDUxzg@mail.gmail.com>
References: <CACi+J=Tu3O-YAkjtJ=4qYHzrkF2sZv1HNkW7BpaUhmCReXzN1g@mail.gmail.com>
	<649664.1646927803@sss.pgh.pa.us>
	<CACi+J=T4C9CRs00=NZhSxpsNhQ+cKgFZHJ2U_Mjrd6p_HDUxzg@mail.gmail.com>

George Woodring <george.woodring@iglass.net> writes:
> I have always thought the way to avoid deadlocks was to update rows in the
> same order by the different updaters.  Is there a better chain of thought
> for updating and deleting rows at the same time?  Do we need to put a lock
> on the table to update, then have the delete queue up waiting for the lock
> to be removed?

With the amount of detail you've provided (viz: none), it's impossible
for anyone to guess what your problem actually is, let alone speculate
on suitable solutions.

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <658814.1646933907@sss.pgh.pa.us>
Permalink:  ../658814.1646933907@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/658814.1646933907@sss.pgh.pa.us

 · 

reply

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: <658814.1646933907@sss.pgh.pa.us>
  References: <CACi+J=Tu3O-YAkjtJ=4qYHzrkF2sZv1HNkW7BpaUhmCReXzN1g@mail.gmail.com> <649664.1646927803@sss.pgh.pa.us> <CACi+J=T4C9CRs00=NZhSxpsNhQ+cKgFZHJ2U_Mjrd6p_HDUxzg@mail.gmail.com> <658814.1646933907@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