Re: refactor AlterDomainAddConstraint (alter domain add constraint)
Re: refactor AlterDomainAddConstraint (alter domain add constraint)
От:
Alvaro Herrera <alvherre@alvh.no-ip.org>
Дата:
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)
Re: refactor AlterDomainAddConstraint (alter domain add constraint)
От:
Peter Eisentraut <peter@eisentraut.org>
Дата:
I have committed the part of this patch that removes the switch statement in AlterDomainAddConstraint(). That one is dead code. I'll study the other discussion a bit more. I agree the current code isn't satisfactory.