Re: a lot of session wait on lock relation - Mailing list pgsql-performance

From James Pang
Subject Re: a lot of session wait on lock relation
Date
Msg-id CAHgTRffkd2uUKxsRKvC3hU-Vje9S=JHxN134YkVN_WhYOw45-g@mail.gmail.com
Whole thread Raw
In response to Re: a lot of session wait on lock relation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: a lot of session wait on lock relation
List pgsql-performance
thanks, we are checking  partition   maintain jobs ,that hold access exclusive lock.

Tom Lane <tgl@sss.pgh.pa.us> 於 2025年5月15日週四 下午9:24寫道:
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Thu, 2025-05-15 at 16:27 +0800, James Pang wrote:
>> why inserts into partition table cause "relation lock" ?

> Something else does; use the pg_blocking_pids() function with the process ID of
> a blocked backend to find out who is holding the lock.

More specifically: the inserts are only trying to get a shared lock.
If they are blocked, it's because some other operation is already
holding an exclusive lock on the table and is not letting go.
Look for uncommitted DDL changes.

More details about that at [1].

                        regards, tom lane

[1] https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: a lot of session wait on lock relation
Next
From: James Pang
Date:
Subject: Re: a lot of session wait on lock relation