Re: Add comments about fire_triggers argument in ri_triggers.c

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: surya poondla <suryapoondla4(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Amit Langote <amitlangote09(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Subject: Re: Add comments about fire_triggers argument in ri_triggers.c
Date: 2026-03-26 15:56:46
Message-ID: 20260327005646.8b9df4658b2dd510d3f95ec0@sraoss.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thank you all for the review and comments.

> Yes Amit, I agree that SPI_execute_snapshot() comments do provide some
> context on AFTER triggers, but I still feel the newly added comment
> in ri_PerformCheck() gives additional context on why the fire_triggers is
> set to false.

Yes, that is what I intended. The existing comments on
SPI_execute_snapshot() explain how the fire_triggers parameter works,
but I would like to add a comment explaining why the AFTER trigger for
RI needs to set it to false.

If the explanation of the effect of fire_triggers seems redundant, I am
fine with the following shorter version:

+ * Set fire_triggers to false to ensure that check triggers fire after all
+ * RI updates on the same row are complete.

I've attached an updated version reflecting this.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v2-add_comments_fire_triggers_in_ri_triggers.patch text/x-diff 704 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2026-03-26 16:00:38 Re: Allow to collect statistics on virtual generated columns
Previous Message Tom Lane 2026-03-26 15:41:53 Re: Adding comments to help understand psql hidden queries