Re: Advisory lock grant order - Mailing list pgsql-general

From Tom Lane
Subject Re: Advisory lock grant order
Date
Msg-id 7777.1410269291@sss.pgh.pa.us
Whole thread Raw
In response to Advisory lock grant order  (Yossi Cohen <yossic00@gmail.com>)
List pgsql-general
Yossi Cohen <yossic00@gmail.com> writes:
> If I request an advisory lock (pg_advisory_lock) with the same key from
> several sessions; will the lock be granted in the same order as it was
> requested?

Usually.  IIRC, the lock code will grant locks out-of-order if a deadlock
would result without it.  There might be some other exceptions but I
don't recall any.

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Crash in 9.4 Beta when partially collapsing left outer joins
Next
From: Michael Paquier
Date:
Subject: Re: Last active time for a database