From ff33a8c8874b43ec55d517ce0612ed79ad08a38a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 13 Jul 2022 11:48:17 -0400 Subject: Remove artificial restrictions on which node types have out/read funcs. The initial version of gen_node_support.pl manually excluded most utility statement node types from having out/read support, and also some raw-parse-tree-only node types. That was mostly to keep the output comparable to the old hand-maintained code. We'd like to have out/read support for utility statements, for debugging purposes and so that they can be included in new-style SQL functions; so it's time to lift that restriction. Most if not all of the previously-excluded raw-parse-tree-only node types can appear in expression subtrees of utility statements, so they have to be handled too. We don't quite have full read support yet; certain custom_read_write node types need to have their handwritten read functions implemented before that will work. Doing this allows us to drop the previous hack in _outQuery to not dump the utilityStmt field in most cases, which means we no longer need manually-maintained out/read functions for Query, so get rid of those in favor of auto-generating them. Fix a couple of omissions in gen_node_support.pl that are exposed through having to handle more node types. catversion bump forced because somebody was sloppy about the field order in the manually-maintained Query out/read functions. (Committers should note that almost all changes in parsenodes.h are now grounds for a catversion bump.) --- src/include/nodes/parsenodes.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/include/nodes/parsenodes.h') diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 3605cea4c72..b0c9c5f2ef6 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -117,8 +117,6 @@ typedef uint32 AclMode; /* a bitmask of privilege bits */ */ typedef struct Query { - pg_node_attr(custom_read_write) - NodeTag type; CmdType commandType; /* select|insert|update|delete|merge|utility */ @@ -126,10 +124,10 @@ typedef struct Query QuerySource querySource; /* where did I come from? */ /* - * query identifier (can be set by plugins); ignored for equal, might not - * be set + * query identifier (can be set by plugins); ignored for equal, as it + * might not be set; also not stored */ - uint64 queryId pg_node_attr(equal_ignore, read_as(0)); + uint64 queryId pg_node_attr(equal_ignore, read_write_ignore, read_as(0)); bool canSetTag; /* do I set the command result tag? */ @@ -409,8 +407,6 @@ typedef struct FuncCall */ typedef struct A_Star { - pg_node_attr(no_read) - NodeTag type; } A_Star; -- cgit v1.2.3