Re: UPDATE run check constraints for affected columns only - Mailing list pgsql-hackers

From jian he
Subject Re: UPDATE run check constraints for affected columns only
Date
Msg-id CACJufxF90yh_BNN9=mVKuF+GNYkqTXgQqWU9QZS7=rdP4kRjxw@mail.gmail.com
Whole thread
In response to Re: UPDATE run check constraints for affected columns only  (jian he <jian.universality@gmail.com>)
Responses Re: UPDATE run check constraints for affected columns only
List pgsql-hackers
On Fri, Jan 23, 2026 at 10:09 AM jian he <jian.universality@gmail.com> wrote:
> code has been further simplified and is now more neat.
> The test is kind of verbose now.
>

if (check_attrs &&
    !bms_is_member(-FirstLowInvalidHeapAttributeNumber, check_attrs) &&
    !bms_overlap(check_attrs, updatedCols))
{
        ereport(DEBUG1,
                errmsg_internal("skipping verification for constraint
\"%s\" on table \"%s\"",
                                check[i].ccname,
                                RelationGetRelationName(rel)));
}

We need tests to reach the above ereport(DEBUG1, branch.

We can use
+SET log_statement to NONE;
+SET client_min_messages TO 'debug1';

to make sure the regress output has the DEBUG1 message.



--
jian
https://www.enterprisedb.com/

Attachment

pgsql-hackers by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: Add pg_stat_recovery system view
Next
From: Michael Paquier
Date:
Subject: Re: Funny behavior in event trigger code with CREATE OR REPLACE VIEW and column additions