Refactor subtype field of AlterDomainStmt
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +1 −1 |
| src/backend/parser/gram.y | modified | +7 −7 |
| src/backend/tcop/utility.c | modified | +6 −6 |
| src/include/nodes/parsenodes.h | modified | +11 −8 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- Standardize the definition of the subtype field of AlterDomainStmt 9 messages · 2025-05-27 → 2025-07-03