Re: query_id: jumble names of temp tables for better pg_stat_statement UX - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Date
Msg-id Z93sH12uzCQHfOo-@paquier.xyz
Whole thread Raw
In response to Re: query_id: jumble names of temp tables for better pg_stat_statement UX  (Christoph Berg <myon@debian.org>)
Responses Re: query_id: jumble names of temp tables for better pg_stat_statement UX
List pgsql-hackers
On Fri, Mar 21, 2025 at 05:26:20PM +0100, Christoph Berg wrote:
> Just one minor thing, I don't understand what you are trying to say in
> this comment:
>
>> +/*
>> + * Note that the argument types are enforced for the per-field custom
>> + * functions.
>> + */
>> +#define JUMBLE_CUSTOM(nodetype, item) \
>> +    _jumble##nodetype##_##item(jstate, expr, expr->item)

In this one, I want to mean that we require a custom per-field
function to look like that:
_jumbleNodefoo_field(JumbleState *jstate, NodeFoo *expr, FieldType field);

Rather than having more generic shape like that:
_jumbleNodefoo_field(JumbleState *jstate, Node *exp,
                     const unsigned char *item, Size size);

So a custom function is defined so as the node type and field type are
arguments.  Perhaps this comment would be better if reworded like
that:
"The arguments of this function use the node type and the field type,
rather than a generic argument like AppendJumble() and the other
_jumble() functions."

If you have a better idea, please feel free..
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: RFC: Additional Directory for Extensions
Next
From: Rustam ALLAKOV
Date:
Subject: Re: meson and check-tests