postgresql/src/include
Peter Eisentraut 964d01ae90 Automatically generate node support functions
Add a script to automatically generate the node support functions
(copy, equal, out, and read, as well as the node tags enum) from the
struct definitions.

For each of the four node support files, it creates two include files,
e.g., copyfuncs.funcs.c and copyfuncs.switch.c, to include in the main
file.  All the scaffolding of the main file stays in place.

I have tried to mostly make the coverage of the output match what is
currently there.  For example, one could now do out/read coverage of
utility statement nodes, but I have manually excluded those for now.
The reason is mainly that it's easier to diff the before and after,
and adding a bunch of stuff like this might require a separate
analysis and review.

Subtyping (TidScan -> Scan) is supported.

For the hard cases, you can just write a manual function and exclude
generating one.  For the not so hard cases, there is a way of
annotating struct fields to get special behaviors.  For example,
pg_node_attr(equal_ignore) has the field ignored in equal functions.

(In this patch, I have only ifdef'ed out the code to could be removed,
mainly so that it won't constantly have merge conflicts.  It will be
deleted in a separate patch.  All the code comments that are worth
keeping from those sections have already been moved to the header
files where the structs are defined.)

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce%40enterprisedb.com
2022-07-09 08:53:59 +02:00
..
access Overload index_form_tuple to allow the memory context to be supplied 2022-07-07 08:14:00 +12:00
bootstrap Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
catalog Automatically generate node support functions 2022-07-09 08:53:59 +02:00
commands Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
common Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
datatype Fix overflow hazards in interval input and output conversions. 2022-04-02 16:12:29 -04:00
executor Automatically generate node support functions 2022-07-09 08:53:59 +02:00
fe_utils Allow db.schema.table patterns, but complain about random garbage. 2022-04-20 11:37:29 -04:00
foreign Update copyright for 2022 2022-01-07 19:04:57 -05:00
jit Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
lib Add missing inequality searches to rbtree 2022-07-08 22:00:03 +03:00
libpq Add some missing PGDLLIMPORT markings 2022-05-12 15:08:45 +09:00
mb Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
nodes Automatically generate node support functions 2022-07-09 08:53:59 +02:00
optimizer Remove no-longer-used parameter for create_groupingsets_path(). 2022-07-01 18:39:30 -04:00
parser Make STRING an unreserved_keyword. 2022-05-30 14:05:20 -04:00
partitioning Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
port Remove HP/Intel Itanium support. 2022-07-08 14:14:57 +12:00
portability Update copyright for 2022 2022-01-07 19:04:57 -05:00
postmaster Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
regex Update copyright for 2022 2022-01-07 19:04:57 -05:00
replication Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
storage Remove HP/Intel Itanium support. 2022-07-08 14:14:57 +12:00
tcop Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
tsearch Add missing 'extern' to function prototypes. 2022-05-12 12:39:33 -07:00
utils Automatically generate node support functions 2022-07-09 08:53:59 +02:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Introduce pg_attribute_nonnull(...) 2022-07-02 12:30:45 +09:00
fmgr.h Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
funcapi.h Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
getaddrinfo.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
getopt_long.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
Makefile Automatically generate node support functions 2022-07-09 08:53:59 +02:00
miscadmin.h Remove HP/Intel Itanium support. 2022-07-08 14:14:57 +12:00
pg_config.h.in Remove HP-UX port. 2022-07-08 14:05:05 +12:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Remove durable_rename_excl() 2022-07-05 12:54:25 +09:00
pg_getopt.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pg_trace.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgstat.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pgtar.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgtime.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
port.h Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
postgres.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
postgres_ext.h Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
postgres_fe.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
rusagestub.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
windowapi.h Update copyright for 2022 2022-01-07 19:04:57 -05:00