Re: [fixed] Trigger test

From: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: Dmitrii Bondar <d(dot)bondar(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Lilian <ontowhee(at)gmail(dot)com>
Subject: Re: [fixed] Trigger test
Date: 2025-03-26 22:46:21
Message-ID: 766da800-4884-41a9-8e8e-71d131dc599c@illuminatedcomputing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 ~{:-)
pj(at)illuminatedcomputing(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-03-26 23:09:12 Re: Doc: clarify possibility of ephemeral discrepancies between state and wait_event in pg_stat_activity
Previous Message Michael Paquier 2025-03-26 22:34:19 Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available