public inbox for [email protected]  
help / color / mirror / Atom feed
From: Amit Langote <[email protected]>
To: Yugo Nagata <[email protected]>
Cc: surya poondla <[email protected]>
Cc: [email protected]
Cc: Kirill Reshke <[email protected]>
Subject: Re: Add comments about fire_triggers argument in ri_triggers.c
Date: Fri, 27 Mar 2026 09:39:17 +0900
Message-ID: <CA+HiwqGFuhuSus8L7O36CYoeeZtGJ4PO0cR94qKDbtMKR4T2OA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAOVWO5q8cfbHiZuL-wSxknnriPCBYpqRCnQKfH38WuLwFuxkSw@mail.gmail.com>
	<[email protected]>

On Fri, Mar 27, 2026 at 12:56 AM Yugo Nagata <[email protected]> wrote:
>
> 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.

Thanks for the updated patch.  Yes, adding the comment might be good,
but I'd suggest a small tweak:

+        * Set fire_triggers to false to ensure that AFTER triggers
are queued in
+        * the outer query's after-trigger context and fire after all
RI updates on
+        * the same row are complete, rather than immediately.

Two changes:

* "check triggers" -> "AFTER triggers", since fire_triggers=false
affects any AFTER triggers queued during the SPI execution, not just
RI check triggers.

* mention of the outer query's after-trigger context to explain the
mechanism by which the deferral works.

Does that additional context help?

-- 
Thanks, Amit Langote





view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add comments about fire_triggers argument in ri_triggers.c
  In-Reply-To: <CA+HiwqGFuhuSus8L7O36CYoeeZtGJ4PO0cR94qKDbtMKR4T2OA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox