Re: Standardize the definition of the subtype field of AlterDomainStmt

From: Quan Zongliang <quanzongliang(at)yeah(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Standardize the definition of the subtype field of AlterDomainStmt
Date: 2025-05-28 02:26:57
Message-ID: 483ea517-4812-47b8-856b-3f7d0d15ed4e@yeah.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025/5/27 11:54, Michael Paquier wrote:
> On Tue, May 27, 2025 at 11:06:46AM +0800, Quan Zongliang wrote:
>> I noticed that the subtype of AlterDomainStmt is directly using constants in
>> the code. It is not conducive to the maintenance and reading of the code.
>> Based on the definition of AlterTableType, use "AD_" as the prefix. Define
>> several macros to replace the original characters.
>> The subtype of AlterTableCmd is defined using an enumeration. The subtypes
>> of AlterDomainStmt are relatively few in number, and the original definition
>> uses characters. These definitions still use characters and maintain the
>> values unchanged. If some plugins or tools are also processing
>> AlterDomainStmt, there will be no errors.
>
> Sounds like a good idea. As far as I can see after a closer lookup at
> the tree, you have updated all the code paths that matter for this
> change, and you have added a CF entry:
> https://commitfest.postgresql.org/patch/5780/
>
> +#define AD_VaidateConstraint 'V' /* VALIDATE CONSTRAINT */
>
Updated
Thank you.

> s/Vaidate/Validate
> --
> Michael

Attachment Content-Type Size
alterdomain_subtype.patch text/plain 5.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wenhui qiu 2025-05-28 02:30:02 Re: Standardize the definition of the subtype field of AlterDomainStmt
Previous Message Richard Guo 2025-05-28 01:58:27 Re: Pathify RHS unique-ification for semijoin planning