pgsql: Remove custom Constraint node read/write implementations

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема pgsql: Remove custom Constraint node read/write implementations
Дата
Msg-id E1rd2J8-0005ni-Pp@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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 <pj@illuminatedcomputing.com>
Discussion: https://www.postgresql.org/message-id/flat/4b27fc50-8cd6-46f5-ab20-88dbaadca645@eisentraut.org

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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Improve ERROR/LOG messages added by commits ddd5f4f54a and 7a424
Следующее
От: Amit Kapila
Дата:
Сообщение: pgsql: Fix the intermittent buildfarm failures in 031_column_list.