On Fri, Dec 19, 2025 at 03:36:16PM -0600, Sami Imseih wrote: > This way, any extension that wishes to return a normalized string from > the same JumbleState can invoke this callback and get consistent results. > pg_stat_statements and other extensions with a need to normalize a query > string based on the locations of a JumbleState do not need to care about the > internals of normalization, they simply invoke the callback and > receive the final > string.
Hmm. I did not wrap completely my head with your problem, but, assuming that what you are proposing goes in the right direction, I am wondering if we should not expose a bit more the jumble query APIs so as the normal default callback can be reused by out-of-core rather than hide it entirely. This would mean exposing GenerateNormalizedQuery(), which also giving a way for callers of JumbleQuery() to pass down a custom callback? This would imply thinking harder about the initialization state we expect in the structure, but I think that we should try to design things so as extensions do not need to copy-paste more code from the core tree at the end, just less of it. Of course, this sentence is written with the same line of thoughts as previously mentioned in the other thread we have discussed: extensions should not be allowed to update a JumbleState after it's been set by the backend code, so as once the same JumbleState pointer is passed down across multiple extensions they don't get confused. If an extension wants to use their own policy within the JumbleState, they had better recreate a new independent one if they are unhappy about has been generated previously. -- Michael
signature.asc
Description: PGP signature
