Re: Fix ALTER DOMAIN VALIDATE CONSTRAINT locking

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: Fix ALTER DOMAIN VALIDATE CONSTRAINT locking
Date: 2026-06-15 01:11:03
Message-ID: 7E81187F-2951-4B0A-99CF-119C58719350@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Jun 14, 2026, at 23:52, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> On Fri, Jun 12, 2026 at 11:02 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)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

Okay, I manually reverted 16a0039dc0d1 with retaining a99c6b56f. I also updated the commit message accordingly. See the attached v3.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v3-0001-Fix-ALTER-DOMAIN-VALIDATE-CONSTRAINT-locking.patch application/octet-stream 8.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-06-15 01:14:46 Re: Use \if/\endif to remove non-libxml2 expected output in regression tests
Previous Message Tom Lane 2026-06-15 00:56:29 Re: Use \if/\endif to remove non-libxml2 expected output in regression tests