Re: Is it possible to log long running recursive/internal postgresql queries?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hotmail <crajac66(at)hotmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Is it possible to log long running recursive/internal postgresql queries?
Date: 2023-02-20 13:52:03
Message-ID: 563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2023-02-17 at 13:28 -0500, Tom Lane wrote:
> Hotmail <crajac66(at)hotmail(dot)com> writes:
> > If it is possible to log long running internal queries as outlined above any guidance would be appreciated.
>
> Either auto_explain or pg_stat_statements could have helped you
> with that, I think.  I believe (without having tested) that if
> configured to track nested statements they would perceive the
> FK enforcement query as a separate statement to track.

Yes, they do.
You need to set "auto_explain.log_nested_statements = on" or
"pg_stat_statements.track = all".

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Hotmail 2023-02-20 15:53:09 Re: Is it possible to log long running recursive/internal postgresql queries?
Previous Message obi reddy 2023-02-18 15:09:28 Re: Vacuum and analyze for objects on physical stand by dbs