Re: Locks analyze

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Rajesh Kumar <rajeshkumar(dot)dba09(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Locks analyze
Date: 2023-10-13 06:02:57
Message-ID: 91d371667a3e27cb0da7001d048d1c417074b6ef.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2023-10-13 at 05:16 +0530, Rajesh Kumar wrote:
> How do I analyze locks and resolve it. Is there only one query that helps?
> This lock issue leading to high connections it seems.

Once you have identified a session that is blocked, get its process ID
from pg_stat_activity and SELECT pg_blocking_pids(12345);
with that process number as argument.

Then you get all the other sessions that block that session.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Zhaoxun Yan 2023-10-13 06:40:03 Re: Fwd: Why does pg_rewind deny permission for pg_read_binary_file() other than 'dbname=postgres'?
Previous Message Scott Ribe 2023-10-13 02:21:34 Re: Locks analyze