Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pT5Sp-0004ns-Op for pgsql-admin@arkaria.postgresql.org; Fri, 17 Feb 2023 18:28:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pT5So-0001Oc-Kx for pgsql-admin@arkaria.postgresql.org; Fri, 17 Feb 2023 18:28:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pT5So-0001OS-AJ for pgsql-admin@lists.postgresql.org; Fri, 17 Feb 2023 18:28:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pT5Sl-0005cJ-VB for pgsql-admin@postgresql.org; Fri, 17 Feb 2023 18:28:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 31HIS0Sq2713827; Fri, 17 Feb 2023 13:28:00 -0500 From: Tom Lane To: Hotmail cc: pgsql-admin Subject: Re: Is it possible to log long running recursive/internal postgresql queries? In-reply-to: References: Comments: In-reply-to Hotmail message dated "Fri, 17 Feb 2023 10:48:42 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2713825.1676658480.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 17 Feb 2023 13:28:00 -0500 Message-ID: <2713826.1676658480@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hotmail 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. regards, tom lane