Re: ALTER DOMAIN ADD NOT NULL NOT VALID

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Quan Zongliang <quanzongliang(at)yeah(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ALTER DOMAIN ADD NOT NULL NOT VALID
Date: 2025-09-24 03:25:23
Message-ID: CACJufxFUydOCGS_Y=iJOr5Q0f+wQZBNJbaee-KpH+nSdUr-F1Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.

please check the attached latest version.

I did some minor cosmetic changes.
similar to commit 16a0039, we can just use ShareUpdateExclusiveLock to validate
existing not-valid not null constraints

for the below issue (should the last UPDATE fail or not),
I have already created a thread at [1].
--------------
create domain d1 as int;
create table dt1(i int, c d1);
insert into dt1 values(1,2);
alter domain d1 add constraint cc check(value <> 2) not valid;
update dt1 set i = i + 1;
--------------

[1]: https://postgr.es/m/CACJufxE2oFcLmrqDrqJrH5k03fv+v9=+-PBs-mV5WsJ=31XMyw@mail.gmail.com

Attachment Content-Type Size
v4-0001-ALTER-DOMAIN-ADD-NOT-NULL-NOT-VALID.patch text/x-patch 17.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2025-09-24 03:59:38 Re: [PATCH] Hex-coding optimizations using SVE on ARM.
Previous Message Richard Guo 2025-09-24 03:10:08 Re: Inconsistent Behavior of GROUP BY ROLLUP in v17 vs master