From ff283308411fc3f220d9957393c14aa38109f52f Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Fri, 11 Feb 2022 04:44:24 +0000 Subject: [PATCH v2] Document creating an extension in replication setup This patch adds the steps to create an extension in a typical postgres replication setup with primary and one or more standbys. --- doc/src/sgml/extend.sgml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index e928894726..de25b3a953 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1408,6 +1408,42 @@ include $(PGXS) any particular database. + + + Creating An Extension In Physical Replication Setup + + + It is important to note few things before creating an extension in a + typical postgres physical replication setup with a primary and one or more + standbys. Firstly, CREATE EXTENSION + commands are replicated to standbys whereas ALTER SYSTEM + commands or configuration parameters set in postgresql.conf + file are not. Creating an extension directly on standbys with + CREATE EXTENSION + command doesn't work as they allow read-only transactions. + + + + If the extension's shared library doesn't need to be specified in + shared_preload_libraries + configuration parameter, then create the extension on the primary, the + standbys will receive it via physical replication. + + + + If the extension's shared library needs to be specified in + shared_preload_libraries + configuration parameter, then set it either via ALTER SYSTEM + command or postgresql.conf file on both primary and + standbys, and restart the servers. Create the extension on the primary, + the standbys will receive it via physical replication. + + + + Note that the extension functions which perform writes to the database + will not work on standbys as they allow read-only transactions. + + -- 2.25.1