Re: Finding detailed information about LOCKS

From: Wasim Devale <wasimd60(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Siraj G <tosiraj(dot)g(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Finding detailed information about LOCKS
Date: 2024-05-03 06:30:48
Message-ID: CAB5fag5gKXxFNCYJtu20rGFfmZBgN5BGjWbpxuKRuCSJcjcOzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Yes this will log in the log file that will be seen pgbadger report under
locks section. We can also mention deadlock_timeout and
max_locks__per_transaction.

Thanks
Wasim

On Fri, 3 May, 2024, 11:56 am Laurenz Albe, <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Fri, 2024-05-03 at 11:52 +0530, Wasim Devale wrote:
> > On Fri, 3 May, 2024, 11:46 am Laurenz Albe, <laurenz(dot)albe(at)cybertec(dot)at>
> wrote:
> > > On Fri, 2024-05-03 at 10:54 +0530, Siraj G wrote:
> > > > I come from Oracle background. In Oracle there is a licensed feature
> (Diagnostics + Tuning)
> > > > upon using which the system keeps historic session records, which
> gives a better way
> > > > to find out locking related details- like the blocking session,
> total sessions blocked
> > > > and the time the blocking event was active. I am finding it a little
> hard in PgSQL
> > > > to find this information.
> > > >
> > > > I am seeking help in finding a detailed analysis on the locks that
> happened yesterday,
> > > > 2 days back or in the last week. Can someone assist please.
> > >
> > > PostgreSQL doesn't keep historical information on these things.
> > >
> > > You need a monitoring tool like pgwatch2 that takes regular snapshots
> of these data
> > > and allows you to access this information.
> >
> > Can we not use pgbadger?
>
> pgBadger can only collect what is in the log file. How would you get that
> information
> into the log file? The best you can get in the log file is the
> information from
> "log_lock_waits = on", which is information about situations where
> somebody had to
> wait for a lock for more than a second. Definitely useful, but capturing
> "pg_stat_activity"
> snapshots will provide more infrmation.
>
> Yours,
> Laurenz Albe
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Dischner, Anton 2024-05-03 08:05:03 AW: postgresql in docker to improve security
Previous Message Laurenz Albe 2024-05-03 06:26:00 Re: Finding detailed information about LOCKS