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 CACJufxFSedy4S_dpNg_cK3z49d72sLtrUvARriMmUpCMUzxuvg@mail.gmail.com
Whole thread Raw
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
hi.

We cache ri_CheckConstraintExprs in ExecConstraints and must initialize them all
if different actions like INSERT and UPDATE, happen together in a query.
Both INSERT and UPDATE need to use these ri_CheckConstraintExprs.
Invoke INSERT AND UPDATE together can happen within MERGE command. We confirm
it's a MERGE operation by checking that resultRelInfo->ri_MergeActions is not
NIL. See ExecMergeNotMatched and ExecMergeMatched.

For cross-partition updates (ExecCrossPartitionUpdate), the operation splits
into an INSERT and DELETE, we can treat it as a single action.



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

Attachment

pgsql-hackers by date:

Previous
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Next
From: Chao Li
Date:
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)