public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: Remove custom Constraint node read/write implementations
Date: Thu, 22 Feb 2024 06:11:47 +0000
Message-ID: <[email protected]> (raw)
Remove custom Constraint node read/write implementations
This is part of an effort to reduce the number of special cases in the
automatically generated node support functions.
Allegedly, only certain fields of the Constraint node are valid based
on contype. But this has historically not been kept up to date in the
read/write functions. The Constraint node is only used for debugging
DDL statements, so there are no strong requirements for its output,
and there is no enforcement for its correctness. (There was no read
support before a6bc3301925.) Commits e7a552f303c and abf46ad9c7b are
examples of where omissions were fixed.
This patch just removes the custom read/write implementations for the
Constraint node type. Now we just output all the fields, which is a
bit more than before, but at least we don't have to maintain these
functions anymore. Also, we lose the string representation of the
contype field, but for this marginal use case that seems tolerable.
This patch also changes the documentation of the Constraint struct to
put less emphasis on grouping fields by constraint type but rather
document for each field how it's used.
Reviewed-by: Paul Jungwirth <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fbc93b8b5f59cfb23c22a26a46ca7bcc826be442
Modified Files
--------------
src/backend/nodes/outfuncs.c | 128 ------------------------------------
src/backend/nodes/readfuncs.c | 145 -----------------------------------------
src/include/nodes/parsenodes.h | 38 ++++-------
3 files changed, 13 insertions(+), 298 deletions(-)
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Remove custom Constraint node read/write implementations
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox