agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: Blessy Thomas <blessy456bthomas@gmail.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Regarding experiencing
Date: Tue, 11 Feb 2025 11:25:57 +0100
Message-ID: <202502111025.yhnpf7xy4bqz@alvherre.pgsql> (raw)
In-Reply-To: <CAJyyjtAZxFGuynAKabj7xOsy9YYMJdAU5zcLTg6Ya7AqgKcbdg@mail.gmail.com>

On 2025-Feb-11, Blessy Thomas wrote:

> These are the  commands I have run in the terminal
> psql (17.0)
> Type "help" for help.
> 
> postgres=# SELECT pg_advisory_lock_shared(1001); //initialising the shared
> lock
>  pg_advisory_lock_shared
> -------------------------
> 
> (1 row)
> 
> postgres=# SELECT pg_advisory_lock(1001); //exclusive lock
>  pg_advisory_lock
> ------------------
> 
> (1 row)

Ah yes, there's no conflict in this case because the holder of both
locks is the same session.  You'd have to request the exclusive lock in
another psql session and you should see it block.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





view thread (5+ messages)  latest in thread

Message-ID: <202502111025.yhnpf7xy4bqz@alvherre.pgsql>
Permalink:  ../202502111025.yhnpf7xy4bqz@alvherre.pgsql/
Also on:    postgresql.org/message-id/202502111025.yhnpf7xy4bqz@alvherre.pgsql

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: alvherre@alvh.no-ip.org, blessy456bthomas@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Regarding experiencing
  In-Reply-To: <202502111025.yhnpf7xy4bqz@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox