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 1pU6aQ-0005Ma-Gj for pgsql-admin@arkaria.postgresql.org; Mon, 20 Feb 2023 13:52:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pU6aO-000450-Vl for pgsql-admin@arkaria.postgresql.org; Mon, 20 Feb 2023 13:52:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU6aO-00044r-GB for pgsql-admin@lists.postgresql.org; Mon, 20 Feb 2023 13:52:08 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pU6aM-0003GL-G0 for pgsql-admin@postgresql.org; Mon, 20 Feb 2023 13:52:08 +0000 Received: by mail-wr1-x42b.google.com with SMTP id c12so1296330wrw.1 for ; Mon, 20 Feb 2023 05:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=MiSc7h60nRmudHOfx8i7Nd4dQicZCYtm6aZ8Cm0skwI=; b=kLOa+nd3yjFbTV+JzgtKOU11bWH/llziMvIOA5GZfFo8Kp9X+fKaUQs7SwwHTZgo1Q h25JlJEkK75EBWr8UXNfWZ4eUlgTstG5YzcYBSLIIuvomzD9/ftZDG6Kt+oly7rrf9Sf 14pqDXwkBy8r1b+FjxQhiHGrbU2aclAeChZ8g0eQFM94fBHJiX6MEddWmSUJdgMwvI/1 IGkC0DF7uqMA2roLYnp5y56I9KAEy/rcUkBRnxc4WKHC1oYYxnBp8TEQ/i2RAfbvIono 8/fcSABnT2d7EUj4F1bYaF0mXBNfDfS+Ia3n5G4r7AMVIhrEv8kiLNS/Ld1EUKYbZXdf aZSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MiSc7h60nRmudHOfx8i7Nd4dQicZCYtm6aZ8Cm0skwI=; b=XzbVdralmE1d/d08RR5H0V+IXACRKpwqNT6uFm79mtlPA3slmBZdzFusF1huOtOMKc Lyau1Syw5WIYt2xmGujsRX6zaJcvJ+lXtCx1BMEEilXril1zemWmSXa2vWpCFZTSLurp mWg26fNL4L39mimtI48AeA6gOL4WJlPTSpn1XXwxewXQlwovMroVQ8KCy2wUcStEEpOl q8QjZ2kDpyMsD6mHrHf2lAVN6ElNkNZubB03y8rBgeWKv0NxMDPdUFb7Zg/pB/VdR7Wc xMXgIIxrSoA3OE6Ri+l7cCIojUH1Q2C1PQTKZ5CFJujEACxFeoVX2REEnfxG9iBjDHNC nm/w== X-Gm-Message-State: AO0yUKWBKnD6BUDGYXBhq6kN8gW7pIyh/rb/lUWD6pHqA3BfXQecoSC4 qvzvMq9Njw92c1utOMfmzwjUfw== X-Google-Smtp-Source: AK7set8uHbMrz+Rn6WXNAPmHb/AFFfJKooDkeklAVFzqKaGaePMQcevzKMFQLuXLx9wuzoYLK/CAKw== X-Received: by 2002:adf:e98b:0:b0:2c5:eaab:ab3 with SMTP id h11-20020adfe98b000000b002c5eaab0ab3mr192155wrm.18.1676901124825; Mon, 20 Feb 2023 05:52:04 -0800 (PST) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:5e:539:1b2c:c52a:475d:310c]) by smtp.gmail.com with ESMTPSA id x17-20020adff651000000b002c563b124basm1741912wrp.103.2023.02.20.05.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 05:52:04 -0800 (PST) Message-ID: <563e0f91d547c52d7cd2b0d2767290818836f615.camel@cybertec.at> Subject: Re: Is it possible to log long running recursive/internal postgresql queries? From: Laurenz Albe To: Tom Lane , Hotmail Cc: pgsql-admin Date: Mon, 20 Feb 2023 14:52:03 +0100 In-Reply-To: <2713826.1676658480@sss.pgh.pa.us> References: <2713826.1676658480@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-02-17 at 13:28 -0500, Tom Lane wrote: > Hotmail writes: > > If it is possible to log long running internal queries as outlined abov= e any guidance would be appreciated. >=20 > Either auto_explain or pg_stat_statements could have helped you > with that, I think.=C2=A0 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 =3D on" or "pg_stat_statements.track =3D all". Yours, Laurenz Albe