Re: UPDATE run check constraints for affected columns only

From: solai v <solai(dot)cdac(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Florin Irion <irionr(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Haritabh Gupta <haritabh1992(at)gmail(dot)com>
Subject: Re: UPDATE run check constraints for affected columns only
Date: 2026-09-08 06:58:12
Message-ID: CAF0whueiCbq=pistq0a6QGZrrYF_q3sm4Ti7+k41xs6rRCRg6w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I reviewed and tested the v8 patch for skipping unnecessary CHECK
constraint verification during UPDATE.
I reproduced the existing behavior before applying the patch and
tested the behavior again after applying it.
My observations after applying the patch:
-CHECK constraints on unaffected columns are skipped during UPDATE.
-CHECK constraints related to updated columns continue to be verified.
-CHECK constraint violations are still detected correctly.
-Generated column cases behaved as expected.
-The BEFORE UPDATE trigger case behaved correctly.
-MERGE with UPDATE and INSERT actions also behaved as expected.
I reviewed the regression tests added in 001_constraint_validation.pl
for the UPDATE, MERGE, and trigger cases.
git diff --check completed without any issues.

Overall, I did not observe any issues during my testing and the patch
behaved as expected.

Regards,
solai

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-09-08 07:05:24 Re: Missing dshash cleanup in pgstat_read_statsfile() after OOM
Previous Message Osama Abdul Qader 2026-09-08 06:53:37 Re: Prevent object capture in CREATE/ALTER EXTENSION scripts