Logging query parmeters in auto_explain

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Logging query parmeters in auto_explain
Date: 2022-05-31 20:33:20
Message-ID: 87ee09mohb.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Inspired by a question on IRC, I noticed that while the core statement
logging system gained the option to log statement parameters in PG 13,
auto_explain was left out.

Here's a patch that adds a corresponding
auto_explain.log_parameter_max_length config setting, which controls the
"Query Parameters" node in the logged plan. Just like in core, the
default is -1, which logs the parameters in full, and 0 disables
parameter logging, while any other value truncates each parameter to
that many bytes.

- ilmari

Attachment Content-Type Size
0001-Log-query-parameters-in-auto_explain.patch text/x-diff 7.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2022-05-31 20:43:26 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Previous Message Thomas Munro 2022-05-31 20:32:07 Re: pg15b1: FailedAssertion("val > base", File: "...src/include/utils/relptr.h", Line: 67, PID: 30485)