Hi, On 2021-04-26 14:21:00 -0400, Tom Lane wrote: > Andres Freund <and...@anarazel.de> writes: > That's sounding like a pretty sane design, actually. Not sure about > the shared-library-name-with-fixed-function-name detail, but certainly > it seems to be useful to separate "I need a query-id" from the details > of the ID calculation. > > Rather than a GUC per se for the ID provider, maybe we could have a > function hook that defaults to pointing at the in-core computation, > and then a module wanting to override that just gets into the hook.
I have a preference to determining the provider via GUC instead of a hook because it is both easier to introspect and easier to configure. If the provider is loaded via a hook, and the shared library is loaded via shared_preload_libraries, one can't easily just turn that off in a single session, but needs to restart or explicitly load a different library (that can't already be loaded). We also don't have any way to show what's hooking into a hook. Greetings, Andres Freund