From: Christophe Pettus <xof@thebuild.com>
To: Sasmit Utkarsh <utkarshsasmit@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Clarification regarding managing advisory locks in postgresql
Date: Wed, 24 Jan 2024 21:11:20 -0800
Message-ID: <31041CF7-85FC-4869-8F57-052B14D0044C@thebuild.com> (raw)
In-Reply-To: <CAM-5MT3Z9_3UTBqavXMkGY8hpKTeubS+VkMLiCGkxdXaHqe_+g@mail.gmail.com>
References: <CAM-5MT3Z9_3UTBqavXMkGY8hpKTeubS+VkMLiCGkxdXaHqe_+g@mail.gmail.com>
> On Jan 24, 2024, at 19:17, Sasmit Utkarsh <utkarshsasmit@gmail.com> wrote:
>
> Need your support on understanding advisory locks in Postgresql and what is the best practice to have advisory locks and unlocks to work properly when we have multiple process forked from single process?
Advisory locks are a shared resource across all of the database in which they were created, and PostgreSQL isn't aware of the process model that the client is using. If a session creates the advisory lock, that same session will need to be the one to release it, and it's up to the client program to keep track of which process is using which session.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: xof@thebuild.com, utkarshsasmit@gmail.com
Subject: Re: Clarification regarding managing advisory locks in postgresql
In-Reply-To: <31041CF7-85FC-4869-8F57-052B14D0044C@thebuild.com>
References: <CAM-5MT3Z9_3UTBqavXMkGY8hpKTeubS+VkMLiCGkxdXaHqe_+g@mail.gmail.com> <31041CF7-85FC-4869-8F57-052B14D0044C@thebuild.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox