From 70ed66b128e0babbfc87f81817530befd0cf8c3f Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Thu, 9 Dec 2021 02:47:01 +0000 Subject: [PATCH v1] 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 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index e928894726..550668e78d 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1408,6 +1408,43 @@ include $(PGXS) any particular database. + + + Creating An Extension In Replication Setup + + + It is important to note few things before creating an extension in a + typical postgres 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. + + + + 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, there + is no need to create it on the standbys as the CREATE EXTENSION + command is replicated. + + + + 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 + standys, reload the postgresql.conf file and restart + the servers. Create the extension on the primary, there is no need to + create it on the standbys as the CREATE EXTENSION + command is replicated. + + + + 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