From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: petermpallesen@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Not using suppress_redundant_updates_trigger in sql-createtrigger.html#examples
Date: Tue, 16 Jun 2020 13:49:04 -0400
Message-ID: <20200616174904.GC12171@momjian.us> (raw)
In-Reply-To: <1369890.1592329185@sss.pgh.pa.us>
References: <159195294959.673.5752624528747900508@wrigleys.postgresql.org>
<20200616103644.GE31175@momjian.us>
<1300920.1592316494@sss.pgh.pa.us>
<20200616164108.GA12171@momjian.us>
<1369890.1592329185@sss.pgh.pa.us>
On Tue, Jun 16, 2020 at 01:39:45PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I have developed the attached patch which is in a better direction.
>
> I still wish you wouldn't jam this topic into an only-marginally-related
> sentence. In the case at hand, the point that the existing text is
> making is that a no-op update will fire triggers. Which is not
> something that suppress_redundant_updates_trigger will suppress,
> so again it seems confusing to mention that in the same breath.
>
> I think that perhaps the right thing to do is add a new para to
> CREATE TRIGGER's "Notes" section, along the lines of
>
> There are a few built-in trigger functions that can be used
> to solve common problems without having to write your own trigger
> code. See Section 9.28.
>
> This would have the advantage of covering the other built-in triggers
> not only suppress_redundant_updates_trigger.
OK, I didn't think there was enough desire to put it its own paragraph,
but I like the idea of mentioning all of the trigger functions; patch
attached.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
Attachments:trigger.diff (text/x-diff, 727B) downloaddiff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgmlindex 303881fcfb..289dd1d9da 100644--- a/doc/src/sgml/ref/create_trigger.sgml+++ b/doc/src/sgml/ref/create_trigger.sgml@@ -457,6 +457,12 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
value did not change.
</para>
+ <para>+ There are a few built-in trigger functions that can be used to+ solve common problems without having to write your own trigger code;+ see <xref linkend="functions-trigger"/>.+ </para>+
<para>
In a <literal>BEFORE</literal> trigger, the <literal>WHEN</literal> condition is
evaluated just before the function is or would be executed, so using
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: pgsql-docs@postgresql.org
Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, petermpallesen@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: Not using suppress_redundant_updates_trigger in sql-createtrigger.html#examples
In-Reply-To: <20200616174904.GC12171@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox