Re: pg_try_advisory_lock is waiting?

From: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_try_advisory_lock is waiting?
Date: 2022-01-29 00:33:55
Message-ID: 1b2e1d4e-298e-86ef-5875-0c89719d48f1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2022-01-29 01:54:29 Re: pg_try_advisory_lock is waiting?
Previous Message Tom Lane 2022-01-29 00:08:14 Re: pg_try_advisory_lock is waiting?