v1-0001-doc-Clarify-behavior-of-triggers-rules-in-a-logical-.patch

text/plain

Filename: v1-0001-doc-Clarify-behavior-of-triggers-rules-in-a-logical-.patch
Type: text/plain
Part: 0
Message: clarifying trigger/rule behavior on logical replication subscribers

Patch

Format: format-patch
Series: patch v1-0001
Subject: doc: Clarify behavior of triggers/rules in a logical subscriber
File+
doc/src/sgml/logical-replication.sgml 7 3
From 23aaa7fe401d85736ebf426626b063075a75c918 Mon Sep 17 00:00:00 2001
From: "Jonathan S. Katz" <jonathan.katz@excoventures.com>
Date: Tue, 6 Jun 2023 09:51:32 -0400
Subject: [PATCH] doc: Clarify 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 link back to the GUC itself.
---
 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 59cf92e6a9..b18cff73ed 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -1654,9 +1654,13 @@ CONTEXT:  processing remote data for replication origin "pg_16395" during "INSER
 
   <para>
    The apply process on the subscriber database always runs with
-   <varname>session_replication_role</varname> set
-   to <literal>replica</literal>, which produces the usual effects on triggers
-   and constraints.
+   <link linkend="guc-session-replication-role"><varname>session_replication_role</varname></link>
+   set to <literal>replica</literal>. This means that, by default,
+   triggers and rules will not fire on a replica. Users can optionally choose to
+   enable triggers and rules on a table using the
+   <link linkend="sql-altertable"><command>ALTER TABLE</command></link> command
+   and the literal>ENABLE TRIGGER</literal> and <literal>ENABLE RULE</literal>
+   clauses.
   </para>
 
   <para>
-- 
2.37.1 (Apple Git-137.1)