Re: Add “FOR UPDATE NOWAIT” lock details to the log. - Mailing list pgsql-hackers

From Yuki Seino
Subject Re: Add “FOR UPDATE NOWAIT” lock details to the log.
Date
Msg-id 52d9125a-07da-4228-bc46-aa7234dabca2@oss.nttdata.com
Whole thread Raw
In response to Re: Add “FOR UPDATE NOWAIT” lock details to the log.  (Yuki Seino <seinoyu@oss.nttdata.com>)
Responses Re: Add “FOR UPDATE NOWAIT” lock details to the log.
List pgsql-hackers
On 2025/02/27 15:44, Yuki Seino wrote:
> (4) 
> https://github.com/postgres/postgres/blob/master/src/backend/access/heap/heapam_handler.c#L463 
>
> ...I don't know how to reproduce it.
I have confirmed that (4) can be reproduced using the following procedure.

(4) 
https://github.com/postgres/postgres/blob/master/src/backend/access/heap/heapam_handler.c#L463
tx1=# SELECT pg_advisory_lock(0);
tx2=# SELECT * FROM pgbench_accounts WHERE pg_advisory_lock(0) IS NOT 
NULL FOR UPDATE NOWAIT;
tx1=# UPDATE pgbench_accounts SET aid = aid WHERE aid = '1';
tx1=# BEGIN;
tx1=# UPDATE pgbench_accounts SET aid = aid WHERE aid = '1';
tx1=# SELECT pg_advisory_unlock(0);

Send the modified patch.

Regard,
Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Extend postgres_fdw_get_connections to return remote backend pid
Next
From: John Naylor
Date:
Subject: Re: Improve CRC32C performance on SSE4.2