Re: Refactor query normalization into core query jumbling

Lukas Fittl <lukas@fittl.com>

From: Lukas Fittl <lukas@fittl.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, zengman <zengman@halodbtech.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Julien Rouhaud <rjuju123@gmail.com>
Date: 2026-03-26T16:35:15Z
Lists: pgsql-hackers
Hi Sami,

On Wed, Mar 25, 2026 at 8:31 PM Sami Imseih <samimseih@gmail.com> wrote:
>
> v6 addresses the comments.
>

Great - I've tested that again and changes look good.

Two more thoughts:

1) I think "SetConstantLengths" should be renamed to
"GetConstantLengths", or "CalculateConstantLengths" in 0002, since
we're no longer modifying JumbleState

2) I wonder if we should export this function in 0002 - that would
specifically help pg_tracing, which also wants to extract inline
parameter values in addition to replacing them with a $n parameter
reference marker - I could also see that being useful for any other
extension that's interested in pulling out parameter values

I've also done some testing with two previously mentioned extensions,
pg_stat_monitor [0] and pg_tracing [1]. Both look like they can be
adapted to the new method with their regression tests succeeding.

Thanks,
Lukas

[0]: https://github.com/lfittl/pg_stat_monitor/commit/d3521de9f6736c1bb745bc31dae736540efe1781
[1]: https://github.com/lfittl/pg_tracing/commit/ecff95a87a1c60e8a5fe47662cc6a2148bd3632f

-- 
Lukas Fittl



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Mark JumbleState as a const in the post_parse_analyze hook

  2. Force standard_conforming_strings to always be ON.

  3. Move pg_stat_statements query jumbling to core.