Re: Standardize the definition of the subtype field of AlterDomainStmt

From: Quan Zongliang <quanzongliang(at)yeah(dot)net>
To: Tender Wang <tndrwang(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Standardize the definition of the subtype field of AlterDomainStmt
Date: 2025-05-28 22:09:00
Message-ID: 5ef3f194-0b7d-46d2-be41-bd27834fe58c@yeah.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Updated

On 2025/5/28 19:30, Tender Wang wrote:
>
>
> Peter Eisentraut <peter(at)eisentraut(dot)org <mailto:peter(at)eisentraut(dot)org>> 于
> 2025年5月28日周三 19:23写道:
>
> On 27.05.25 05:06, 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.
>
> You can still make it an enum and assign the currently in use values to
> the new symbols, like
>
> enum AlterDomainType
> {
>      AD_AlterDefault = 'T',
>      AD_DropNotNull = 'N',
>      ...
>
> I would prefer that.
>
> +1
>
> --
> Thanks,
> Tender Wang

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2025-05-28 22:29:37 Re: Correct documentation for protocol version
Previous Message Jacob Champion 2025-05-28 22:01:49 Re: pg16 && GSSAPI && Heimdal/Macos