Are advisory locks guaranteed to be First Come First Serve? And can the behavior be relied upon?

From: Hemil Ruparel <hemilruparel2002(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Are advisory locks guaranteed to be First Come First Serve? And can the behavior be relied upon?
Date: 2020-08-27 04:40:07
Message-ID: CANW1aT_Pc+xdoN_D-dK+j3uE+D_2wfFZu26aAfprWsoGhoNu-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was playing with Advisory locks. I opened three connections to the
database And obtained a lock with the same key. I noticed that the locks
were obtained in the order of requests. I was wondering whether the locks
are guaranteed to be First Come First Serve and can this behaviour be
relied upon.

I read the docs here
<https://www.postgresql.org/docs/current/explicit-locking.html>. But it
didn't mention anything.

Thanks a lot for your time and efforts

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Zhu 2020-08-27 05:53:28 Re: Calling a SQL function inside a C function
Previous Message Pavel Stehule 2020-08-27 03:53:01 Re: Calling a SQL function inside a C function