From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove artificial restrictions on which node types have out/read
Date: Wed, 13 Jul 2022 15:48:26 +0000
Message-ID: <E1oBebB-002cG9-DT@gemulon.postgresql.org> (raw)
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.)
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ff33a8c8874b43ec55d517ce0612ed79ad08a38a
Modified Files
--------------
src/backend/nodes/gen_node_support.pl | 39 ++++++-------------
src/backend/nodes/outfuncs.c | 73 -----------------------------------
src/backend/nodes/readfuncs.c | 50 ------------------------
src/include/catalog/catversion.h | 6 ++-
src/include/nodes/parsenodes.h | 10 ++---
5 files changed, 19 insertions(+), 159 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Remove artificial restrictions on which node types have out/read
In-Reply-To: <E1oBebB-002cG9-DT@gemulon.postgresql.org>
References: <E1oBebB-002cG9-DT@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox