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 <[email protected]>
Reviewed-by: Peter Eisentraut <[email protected]>
Reviewed-by: wenhui qiu <[email protected]>
Reviewed-by: Tender Wang <[email protected]>
Discussion: https://postgr.es/m/[email protected]

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 via email to