pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_try_advisory_lock is waiting?
Date: Fri, 28 Jan 2022 19:33:55 -0500
Message-ID: <1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.com> (raw)
In-Reply-To: <2858894.1643414894@sss.pgh.pa.us>
References: <54e6a2bc-3546-88c7-0382-c74f23e4b668@gmail.com>
	<2858894.1643414894@sss.pgh.pa.us>

On 1/28/22 19:08, Tom Lane wrote:
> I doubt it.  I think the FOR UPDATE in the sub-select is blocked
> because the other session has an uncommitted update on the row
> it wants to lock.  This command won't reach the pg_try_advisory_lock
> call until that row lock comes free.

Yes, I figured it out, but pg_try_advisory_lock returned TRUE even 
without "FOR UPDATE" clause in the subquery. Shouldn't it return false 
because it can't lock the row until the uncommitted update finishes?

Regards

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (7+ messages)  latest in thread

Message-ID: <1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.com>
Permalink:  ../1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.com/
Also on:    postgresql.org/message-id/1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.com

 · 

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 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: gogala.mladen@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: pg_try_advisory_lock is waiting?
  In-Reply-To: <1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.com>
  References: <54e6a2bc-3546-88c7-0382-c74f23e4b668@gmail.com> <2858894.1643414894@sss.pgh.pa.us> <1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.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