deadlock avoidance

From: Clarence Gardner <clarence(at)silcom(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: deadlock avoidance
Date: 2006-09-25 23:58:37
Message-ID: Pine.SUN.4.02.10609252353500.11969-100000@beach.silcom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I noticed the following in some of our code today:
select ... <join list> ... for update of a, b;

Inasmuch as the cardinal rule for avoiding deadlocks is to acquire
locks in a consistent order, should such a construction be avoided
in favor of two separate "select ... for update" statements so that
the order of acquisition of a and b is known? I'm assuming that
there is no ordering implied/guaranteed by "for update of a, b".

Or am I missing something?

Clarence

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-09-26 01:47:02 Re: deadlock avoidance
Previous Message Michael Glaesemann 2006-09-25 23:45:22 Re: getting dates in the past