> On Jun 12, 2026, at 19:47, Fujii Masao <[email protected]> wrote:
> 
> On Mon, Jun 8, 2026 at 12:54 PM Chao Li <[email protected]> wrote:
>> See the attached patch for details. I also added an isolation test that 
>> follows the repro above.
> 
> Thanks for the patch! It looks good to me.
> 
> I just have a few minor review comments.
> 
> 
> * The lockmode is used for relations using the domain.  It should be
> * ShareLock when adding a new constraint to domain.  It can be
> * ShareUpdateExclusiveLock when validating an existing constraint.
> 
> This comment in validateDomainCheckConstraint() still references
> ShareUpdateExclusiveLock, so it seems to need updating.
> 
> 
> Regarding the test, I think it would be safer to also check whether
> pg_constraint.convalidated is set correctly. For example:
> 
> -----------------------
> step s3_validate       { ALTER DOMAIN alter_domain_validate_d VALIDATE
> CONSTRAINT alter_domain_validate_d_pos; }
> +step s3_validated      { SELECT convalidated FROM pg_constraint WHERE
> conname = 'alter_domain_validate_d_pos'; }
> step s3_check          { SELECT count(*) FROM alter_domain_validate_t; }
> 
> -permutation s1_lock s2_insert s3_add s3_validate s1_unlock s3_check
> +permutation s1_lock s2_insert s3_add s3_validate s1_unlock s3_validated 
> s3_chec
> -----------------------
> 
> 
> After the fix is committed, we should probably also ask Bruce to update
> the following v19 release note item?:
> 
>    Reduce lock level of ALTER DOMAIN ... VALIDATE CONSTRAINT to match
> ALTER TABLE ... VALIDATE CONSTRAINT (Jian He) §
> 
> Regards,
> 
> -- 
> Fujii Masao

Hi Fujii-san,

Thanks for picking this up. PFA v2 that addressed your comments.

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




Attachment: v2-0001-Fix-ALTER-DOMAIN-VALIDATE-CONSTRAINT-locking.patch
Description: Binary data

Reply via email to