Re: Fix ALTER DOMAIN VALIDATE CONSTRAINT locking

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Álvaro Herrera <alvherre@kurilemu.de>, Postgres hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter@eisentraut.org>, jian he <jian.universality@gmail.com>
Date: 2026-06-14T15:52:44Z
Lists: pgsql-hackers
On Fri, Jun 12, 2026 at 11:02 PM Chao Li <li.evan.chao@gmail.com> wrote:
> From a runtime behavior perspective, yes, this patch reverts the behavior change made by 16a0039dc0d1.

Yes.


> However:
>
> * 16a0039dc0d1 also refactored validateDomainCheckConstraint() to allow passing in the lock mode, and I think that refactoring is still useful and maybe worth keeping.

I'd prefer to remove that refactoring code, since after the fix there
is no longer any user of the lockmode argument in
validateDomainCheckConstraint().


> * A follow-up commit, a99c6b56f, made validating an already-validated constraint a no-op. A direct revert of 16a0039dc0d1 would conflict with later changes around this code.

Yes, but fixing that conflict does not seem very difficult, no?


> * This patch also adds a test to prevent future changes from making the same mistake.

+1 for adding the test!


> > If we make this change, then the release note item should be removed
> > entirely, ISTM.
> >
>
> True. Once this patch is pushed, this item should be removed from the release note.

Agreed.

Regards,

-- 
Fujii Masao



Commits

  1. Fix ALTER DOMAIN VALIDATE CONSTRAINT locking