clarifying trigger/rule behavior on logical replication subscribers

From: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
To: Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: clarifying trigger/rule behavior on logical replication subscribers
Date: 2023-06-06 13:58:14
Message-ID: 5bb2c9a2-499f-e1a2-6e33-5ce96b35cc4a@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hi,

While answering a question on "do triggers fire on a logical replication
subscriber by default?" I tried to look up a reference to this behavior
in the docs. There wasn't a clear reference point, but on the
architecture page[1], I found this line that was closest to the answer:

"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."

which assumes that the reader knows what the "usual effects" are.

Attached is a patch that disambiguates this.

Two additional items:

1. I do think this should be backpatched because it clarifies an
existing behavior.

2. I don't know if we want to add a note about the trigger/rule behavior
elsewhere in the logical replication section. I don't know if a reader
would be expecting to find this in the "architecture" section.

Thanks,

Jonathan

[1]
https://www.postgresql.org/docs/devel/logical-replication-architecture.html

Attachment Content-Type Size
v1-0001-doc-Clarify-behavior-of-triggers-rules-in-a-logical-.patch text/plain 1.7 KB

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message yanliang lei 2023-06-06 14:30:56 bpchar datatype is not equal to character(1) data type
Previous Message Daniel Gustafsson 2023-06-06 07:56:05 Re: confusing positioning of notes in connection settings