Re: Advisory lock grant order

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yossi Cohen <yossic00(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Advisory lock grant order
Date: 2014-09-09 13:28:11
Message-ID: 7777.1410269291@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yossi Cohen <yossic00(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2014-09-09 13:34:30 Re: Last active time for a database
Previous Message Tom Lane 2014-09-09 13:25:07 Re: Crash in 9.4 Beta when partially collapsing left outer joins