回复: UPDATE run check constraints for affected columns only

From: li carol <carol(dot)li2025(at)outlook(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: 回复: UPDATE run check constraints for affected columns only
Date: 2025-12-01 09:24:11
Message-ID: KL1PR01MB6662B7FB050E34241D73956381DBA@KL1PR01MB6662.apcprd01.prod.exchangelabs.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

+1 on Tom's point about BEFORE UPDATE triggers.
I also noticed that in execReplication.c, ExecSimpleRelationUpdate() passes CMD_INSERT to ExecConstraints():
ExecConstraints(CMD_INSERT, resultRelInfo, slot, estate);
I think this should be CMD_UPDATE?

Regards,
Yuan Li(carol)

-----邮件原件-----
发件人: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
发送时间: 2025年12月1日 14:33
收件人: jian he <jian(dot)universality(at)gmail(dot)com>
抄送: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
主题: Re: UPDATE run check constraints for affected columns only

jian he <jian(dot)universality(at)gmail(dot)com> writes:
> The attached patch implements the $subject.

Does this cover the case where a BEFORE UPDATE trigger has modified columns that were not mentioned in UPDATE...SET?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-12-01 09:27:53 Re: Proposal: Conflict log history table for Logical Replication
Previous Message shveta malik 2025-12-01 09:14:04 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart