public inbox for [email protected]
help / color / mirror / Atom feedFrom: Marcelo Fernandes <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: [email protected]
Subject: Re: Logging queries executed by SPI_execute
Date: Tue, 4 Feb 2025 17:08:48 +1300
Message-ID: <CAM2F1VPz8qw2S-ND1xHWqaDw+wZ6cpeXErsONYCJLob=mc_Rqg@mail.gmail.com> (raw)
In-Reply-To: <CAFj8pRAKZBhsFQVcmsfFfvEYgv0SeA7TWgjvLRtzCfdB6ws3JQ@mail.gmail.com>
References: <CAM2F1VNmR59qggpGMAeGu34_DCj_7h-3mTE1VP=VRnKE+F5ZJA@mail.gmail.com>
<CAFj8pRAKZBhsFQVcmsfFfvEYgv0SeA7TWgjvLRtzCfdB6ws3JQ@mail.gmail.com>
On Mon, Feb 3, 2025 at 6:46 PM Pavel Stehule <[email protected]> wrote:
> The queries executed by SPI are never executed on the top level. These queries are marked as nested.
>
> So you need to use auto_explain https://www.postgresql.org/docs/current/auto-explain.html with active auto_explain.log_nested_statements
Thanks Pavel, I have tried that but however couldn't succeed.
I have added this to my postgres.conf file:
session_preload_libraries = 'auto_explain'
auto_explain.log_nested_statements = true
After running pg_repack, which calls SPI_execute* functions, I can't really see
those functions being propagated to the logs.
I have a workaround in place, which is to add elog calls such as
elog(LOG, "...")
to capture the queries. But of course, ideally a postgres.conf setting would be
more handy.
Best,
Marcelo
view thread (2+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Logging queries executed by SPI_execute
In-Reply-To: <CAM2F1VPz8qw2S-ND1xHWqaDw+wZ6cpeXErsONYCJLob=mc_Rqg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox