Re: refactor AlterDomainAddConstraint (alter domain add constraint) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: refactor AlterDomainAddConstraint (alter domain add constraint)
Date
Msg-id 202412061448.ont2q5bctxfm@alvherre.pgsql
Whole thread Raw
List pgsql-hackers
On 2024-Dec-06, jian he wrote:

> basically processCASbits
> from
> processCASbits($3, @3, "NOT NULL")
> processCASbits($5, @5, "CHECK")
> to
> processCASbits($3, @3, "DOMAIN with NOT NULL")
> processCASbits($5, @5, "DOMAIN with CHECK")

This doesn't actually work from a translation point of view, because the
actual error message is split in two parts.  I think it might be better
to pass a non-NULL variable to processCASbits, then in the caller check
whether that flag is true; if so, raise the error in a single ereport().

BTW the way to test this is to apply your patch, then do "make
update-po", then look at the src/backend/po/*.po.new files which contain
the merged strings.  In this case, your new "DOMAIN with NOT NULL" string
is not going to appear in the message catalog, because processCASbits()
is not listed in GETTEXT_TRIGGERS in nls.mk.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Nunca se desea ardientemente lo que solo se desea por razón" (F. Alexandre)



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Pass ParseState as down to utility functions.
Next
From: Nathan Bossart
Date:
Subject: Re: Popcount optimization using SVE for ARM