Re: Clarification regarding managing advisory locks in postgresql

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Sasmit Utkarsh <utkarshsasmit(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Clarification regarding managing advisory locks in postgresql
Date: 2024-01-25 05:11:20
Message-ID: 31041CF7-85FC-4869-8F57-052B14D0044C@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jan 24, 2024, at 19:17, Sasmit Utkarsh <utkarshsasmit(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sasmit Utkarsh 2024-01-25 10:43:44 Re: Clarification regarding managing advisory locks in postgresql
Previous Message Sasmit Utkarsh 2024-01-25 03:17:30 Clarification regarding managing advisory locks in postgresql