Avoiding deadlocks on mass delete / update

From: Роман Маширов <mrj(at)nandu(dot)ru>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Avoiding deadlocks on mass delete / update
Date: 2010-03-22 15:22:38
Message-ID: 4BA78B3E.70304@nandu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've got a simple 'spool' table, one process 'worker' reads and updates
this table, other 'stat' performs 'delete ... where ... returning *'.
Sometimes I've got dedlocks on delete operation in 'stat', seems like at
the moment of expiration of data by timeout some state changes arrived
from worker. So the question, is it possible to somehow set order of row
deletion in such bulk delete operation, to avoid deadlocks?

Thank you beforehand
--
MRJ

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-03-22 15:23:33 Re: Determining the OID of a certain type
Previous Message Alban Hertroys 2010-03-22 15:16:47 Re: Daylight savings time confusion