Not using suppress_redundant_updates_trigger in sql-createtrigger.html#examples

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: petermpallesen(at)gmail(dot)com
Subject: Not using suppress_redundant_updates_trigger in sql-createtrigger.html#examples
Date: 2020-06-12 09:09:09
Message-ID: 159195294959.673.5752624528747900508@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/bug-reporting.html
Description:

Hi
I was stumbling across the trigger function
‘suppress_redundant_updates_trigger’ in
https://www.postgresql.org/docs/devel/functions-trigger.html and I would
just ask if there is any reason of this not being int the documentation in
https://www.postgresql.org/docs/13/sql-createtrigger.html.
So after

Call a function to log updates of accounts, but only if something changed:

CREATE TRIGGER log_update
AFTER UPDATE ON accounts
FOR EACH ROW
WHEN (OLD.* IS DISTINCT FROM NEW.*)
EXECUTE FUNCTION log_account_update();

There could be an alternative implementation as well

CREATE TRIGGER log_update
AFTER UPDATE ON accounts
FOR EACH ROW
EXECUTE FUNCTION log_account_update();

CREATE TRIGGER suppress_redundant_account_after_updates
AFTER UPDATE ON accounts
FOR EACH ROW EXECUTE FUNCTION suppress_redundant_updates_trigger();

Just to introduce and like the feature.

Thank you for your great work best regards

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Fontana Daniel C (Desartec S.R.L.) 2020-06-12 14:11:52 Replication Binary in PostgreSQL 12
Previous Message Dong Wook Lee 2020-06-12 08:55:35 Fwd: [PATCH] pg_dump: Add example and link for --encoding option