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 12:41:08 -0400
Message-ID: <20200616164108.GA12171@momjian.us> (raw)
In-Reply-To: <1300920.1592316494@sss.pgh.pa.us>
References: <159195294959.673.5752624528747900508@wrigleys.postgresql.org>
<20200616103644.GE31175@momjian.us>
<1300920.1592316494@sss.pgh.pa.us>
On Tue, Jun 16, 2020 at 10:08:14AM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I have created the attached patch to mention
> > suppress_redundant_updates_trigger() in this case. I don't think having
> > an actual example is warranted.
>
> I don't like this patch, because in fact
> suppress_redundant_updates_trigger is entirely unrelated to the stated
> purpose of that example (namely, to log something if the table was
> changed). The way you've written it makes it sound like
> suppress_redundant_updates_trigger could be used as an alternative
> implementation of that requirement.
Ah, I see your point.
> If you want to mention suppress_redundant_updates_trigger somewhere
> in this area, that's fine, but it should be treated as an independent
> topic rather than being wedged into the middle of an unrelated example.
> Maybe a distinct para saying something like "To suppress no-op updates
> of a table, see suppress_redundant_updates_trigger." (and making that
> an actual link would be a good idea).
I have developed the attached patch which is in a better direction.
--
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, 792B) downloaddiff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgmlindex 303881fcfb..7ef96c5650 100644--- a/doc/src/sgml/ref/create_trigger.sgml+++ b/doc/src/sgml/ref/create_trigger.sgml@@ -454,7 +454,9 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
row's contents by <literal>BEFORE UPDATE</literal> triggers are not considered.
Conversely, a command such as <literal>UPDATE ... SET x = x ...</literal>
will fire a trigger on column <literal>x</literal>, even though the column's
- value did not change.+ value did not change; use function <link+ linkend="functions-trigger"><function>suppress_redundant_updates_trigger</function></link>+ in triggers to suppress non-change updates.
</para>
<para>
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: <20200616164108.GA12171@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