public inbox for [email protected]  
help / color / mirror / Atom feed
From: Paul Jungwirth <[email protected]>
To: Dmitrii Bondar <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Cc: Lilian <[email protected]>
Subject: Re: [fixed] Trigger test
Date: Wed, 26 Mar 2025 15:46:21 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<174293570374.60294.13024599409215069922.pgcf@coridan.postgresql.org>
	<[email protected]>

Hi Dmitrii,

Thanks for the quick update!

On 3/26/25 02:45, Dmitrii Bondar wrote:
 >> 3. Consider updating documentation for doc/src/contrib-spi.sgml, or any file as appropriate, to
 >> reflect the changes.
 >
 > The changes have now been added to doc/src/contrib-spi.sgml. I also added a consideration note about
 > interactions with BEFORE triggers.

This looks good. I have a couple small grammar suggestions. This:

+   To use, create a <literal>AFTER INSERT OR UPDATE</literal> trigger using this

should be:

+   To use, create an <literal>AFTER INSERT OR UPDATE</literal> trigger using this

and this:

+   To use, create a <literal>AFTER DELETE OR UPDATE</literal> trigger using this

should be this:

+   To use, create an <literal>AFTER DELETE OR UPDATE</literal> trigger using this

Also re this part of the patch:

@@ -592,10 +598,15 @@ check_foreign_key(PG_FUNCTION_ARGS)
     }
     else
     {
+     const char* operation;
+
+     if (action == 'c')
+       operation = is_update ? "updated" : "deleted";
+     else
+       operation = "set to null";
  #ifdef REFINT_VERBOSE
       elog(NOTICE, "%s: " UINT64_FORMAT " tuple(s) of %s are %s",
-        trigger->tgname, SPI_processed, relname,
-        (action == 'c') ? "deleted" : "set to null");
+        trigger->tgname, SPI_processed, relname, operation);
  #endif
     }
     args += nkeys + 1;    /* to the next relation */

We can put all the new lines inside the #ifdef, can't we?

 > Can you also help me with the patch status? What status should I move the patch to?

I think if you make those changes we should mark this as Ready for Committer.

Yours,

-- 
Paul              ~{:-)
[email protected]






view thread (7+ 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: [fixed] Trigger test
  In-Reply-To: <[email protected]>

* 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