pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Hotmail <crajac66@hotmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Is it possible to log long running recursive/internal postgresql queries?
Date: Mon, 20 Feb 2023 14:52:03 +0100
Message-ID: <563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at> (raw)
In-Reply-To: <2713826.1676658480@sss.pgh.pa.us>
References: <ddc10360-1072-4e3d-9584-436cdb7d4d82@Spark>
	<MW4PR11MB6838BAF2DF065F88CD5EE301D7A19@MW4PR11MB6838.namprd11.prod.outlook.com>
	<2713826.1676658480@sss.pgh.pa.us>

On Fri, 2023-02-17 at 13:28 -0500, Tom Lane wrote:
> Hotmail <crajac66@hotmail.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





view thread (5+ messages)  latest in thread

Message-ID: <563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at>
Permalink:  ../563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at/
Also on:    postgresql.org/message-id/563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, crajac66@hotmail.com
  Subject: Re: Is it possible to log long running recursive/internal postgresql queries?
  In-Reply-To: <563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox