From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor subtype field of AlterDomainStmt
Date: Thu, 03 Jul 2025 07:35:26 +0000
Message-ID: <E1uXETe-004Tvt-1U@gemulon.postgresql.org> (raw)
Refactor subtype field of AlterDomainStmt
AlterDomainStmt.subtype used characters for its subtypes of commands,
SET|DROP DEFAULT|NOT NULL and ADD|DROP|VALIDATE CONSTRAINT, which were
hardcoded in a couple of places of the code. The code is improved by
using an enum instead, with the same character values as the original
code.
Note that the field was documented in parsenodes.h and that it forgot to
mention 'V' (VALIDATE CONSTRAINT).
Author: Quan Zongliang <quanzongliang@yeah.net>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: wenhui qiu <qiuwenhuifx@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Discussion: https://postgr.es/m/41ff310b-16bd-44b9-a3ef-97e20f14b709@yeah.net
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8ec04c8577a1aa3aac4b77b2747dde30c8f9c8c6
Modified Files
--------------
src/backend/commands/tablecmds.c | 2 +-
src/backend/parser/gram.y | 14 +++++++-------
src/backend/tcop/utility.c | 12 ++++++------
src/include/nodes/parsenodes.h | 19 +++++++++++--------
src/tools/pgindent/typedefs.list | 1 +
5 files changed, 26 insertions(+), 22 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Refactor subtype field of AlterDomainStmt
In-Reply-To: <E1uXETe-004Tvt-1U@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