On Tue, Jun 16, 2020 at 10:08:14AM -0400, Tom Lane wrote:
> Bruce Momjian <[email protected]> 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 <[email protected]> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml
index 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>