make VALIDATE domain constraint lock on related relations as ShareUpdateExclusiveLock - Mailing list pgsql-hackers

From jian he
Subject make VALIDATE domain constraint lock on related relations as ShareUpdateExclusiveLock
Date
Msg-id CACJufxHz92A88NLRTA2msgE2dpXpE-EoZ2QO61od76-6bfqurA@mail.gmail.com
Whole thread Raw
Responses Re: make VALIDATE domain constraint lock on related relations as ShareUpdateExclusiveLock
List pgsql-hackers
hi.

We can still perform DML operations on a table while validating its
check constraint.
Similarly, it should be fine to do DML while validating domain constraints?
but currently, it's not allowed for domain constraints.

The attached patch addresses this problem.
so, with the patch, the following is allowed:

create domain d1 as int;
create table t(a d1);
alter domain d1 add constraint cc10 check(value > 10) not valid;

begin;
alter domain d1 validate constraint cc10;

--another session
INSERT INTO T SELECT 8;

Attachment

pgsql-hackers by date:

Previous
From: Alena Rybakina
Date:
Subject: Re: Useless LEFT JOIN breaks MIN/MAX optimization
Next
From: "David G. Johnston"
Date:
Subject: Re: PG 18 release notes draft committed