Re: Refactor query normalization into core query jumbling

2025-12-19 Thread Sami Imseih
> While this is technically correct so the compiler does not complain (because > clocations is a non const pointer in JumbleState and the added const does not > apply to what clocations points to), I think that adding const here is > misleading. Yes, I am not happy with this. I initially thought

Re: Refactor query normalization into core query jumbling

2025-12-18 Thread Bertrand Drouvot
Hi, On Thu, Dec 18, 2025 at 06:44:17PM -0600, Sami Imseih wrote: > For the second point, since JumbleState can be shared by multiple > extensions, hooks should receive it as a const pointer. This > signals read-only intent and prevents extensions from > accidentally modifying it through the hook.

Refactor query normalization into core query jumbling

2025-12-18 Thread Sami Imseih
Hi, A while back, there was a discussion about moving the query normalization code out of pg_stat_statements and into core query jumbling [0]. This conversation also led to hardening the hooks (currently only post_parse_analyze) that receive JumbleState [1]. For the first point, `generate_normali