Re: deadlock in single-row select-for-update + update scenario? How could it happen? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: deadlock in single-row select-for-update + update scenario? How could it happen?
Date
Msg-id CAKrjmhfW7PO5CaH=XqiZ6Nr566pww=MkmUmEPcTrq2RU0iMsjg@mail.gmail.com
Whole thread Raw
In response to Re: deadlock in single-row select-for-update + update scenario? How could it happen?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Aug 22, 2014 at 7:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
You have not shown us the full sequence of events leading up to the
deadlock failure, but I hypothesize that there were yet other transactions
that updated that same row in the very recent past.  That might allow
there to be more than one tuple lock involved (ie, locks on different
versions of the row), which would create some scope for a deadlock
failure.

Well, showing all events is difficult due to parallelization of importer, but shouldn't "select for update" solve the problem of other locks?

The transactions are exactly as shown - select for update and then update.

depesz

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: deadlock in single-row select-for-update + update scenario? How could it happen?
Next
From: Adrian Klaver
Date:
Subject: Re: deadlock in single-row select-for-update + update scenario? How could it happen?