From 05fb8954b5aa3634bdbce148298b0ba4e3207932 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Thu, 22 Jun 2023 11:49:10 +0530 Subject: [PATCH] Doc: Clarify the behavior of triggers/rules in a logical subscriber. By default, triggers and rules do not fire on a logical replication subscriber based on the "session_replication_role" GUC being set to "replica". However, the docs in the logical replication section assumed that the reader understood how this GUC worked. This modifies the docs to be more explicit and links back to the GUC itself. Author: Jonathan Katz, Peter Smith Reviewed-by: Vignesh C, Euler Taveira Backpatch-through: 11 Discussion: https://postgr.es/m/5bb2c9a2-499f-e1a2-6e33-5ce96b35cc4a@postgresql.org --- doc/src/sgml/logical-replication.sgml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 43b7e824cb6..eb4878a1c94 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -443,9 +443,13 @@ The apply process on the subscriber database always runs with - session_replication_role set - to replica, which produces the usual effects on triggers - and constraints. + session_replication_role + set to replica. This means that, by default, + triggers and rules will not fire on a subscriber. Users can optionally choose to + enable triggers and rules on a table using the + ALTER TABLE command + and the ENABLE TRIGGER and ENABLE RULE + clauses. -- 2.39.5