From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Reduce lock level for ALTER DOMAIN ... VALIDATE CONSTRAINT |
Date: | 2025-08-22 07:00:53 |
Message-ID: | E1upLlc-00162U-1r@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Reduce lock level for ALTER DOMAIN ... VALIDATE CONSTRAINT
Reduce from ShareLock to ShareUpdateExclusivelock. Validation during
ALTER DOMAIN ... ADD CONSTRAINT keeps using ShareLock.
Example:
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 values (8);
Now we should still be able to perform DML operations on table t while
the domain constraint is being validated. The equivalent works
already on table constraints.
Author: jian he <jian(dot)universality(at)gmail(dot)com>
Reviewed-by: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Reviewed-by: wenhui qiu <qiuwenhuifx(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/CACJufxHz92A88NLRTA2msgE2dpXpE-EoZ2QO61od76-6bfqurA%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/16a0039dc0d1d0cdfadaf38cd3a30f3c8f590c48
Modified Files
--------------
src/backend/commands/typecmds.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2025-08-22 10:21:16 | pgsql: Revert GetTransactionSnapshot() to return historic snapshot duri |
Previous Message | Amit Kapila | 2025-08-22 05:39:13 | pgsql: Doc: Fix typo in logicaldecoding.sgml. |