Add support for custom_query_jumble as a node field attribute
This option gives the possibility for query jumble to define a custom
routine for the field of a Node, extending support for
custom_query_jumble as a node field attribute. When dealing with
complex node structures, this can be simpler than having to enforce a
custom function across a full node.
Custom functions need to be defined in queryjumblefuncs.c, named as
_jumble${node}_${field}(), and use in input the JumbleState, the node
and its field. The field is not really required if we have the Node,
but it makes custom implementations somewhat easier to think about. The
code generated by gen_node_support.pl uses a macro called
JUMBLE_CUSTOM(), hiding the internals of the logic inside
queryjumblefuncs.c.
This will be used by an upcoming patch manipulating adding a custom
routine into a field of RangeTblEntry, but this facility can become
useful in more cases.
Reviewed-by: Christoph Berg <myon@debian.org>
Discussion: https://postgr.es/m/Z9y43-dRvb4EtxQ0@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5ac462e2b7ac97685de9f34b17296640220d0bfc
Modified Files
--------------
src/backend/nodes/gen_node_support.pl | 13 ++++++++++++-
src/backend/nodes/queryjumblefuncs.c | 3 +++
src/include/nodes/nodes.h | 4 ++++
3 files changed, 19 insertions(+), 1 deletion(-)