How sync settings or extensions in streaming replication

Started by 苏士涛almost 10 years ago3 messagesgeneral
Jump to latest
#1苏士涛
tinnnysu@gmail.com

Hi,

I am new to PostgreSQL, and i have a question about streaming
replication. If i enable some extension on master with or without
native code(in c), do I need to enable this extension on slave? Or
PostgreSQL sync this automatic. Same to settings in postgresql.conf.
Sorry for my pool English

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Michael Paquier
michael@paquier.xyz
In reply to: 苏士涛 (#1)
Re: How sync settings or extensions in streaming replication

On Wed, Jul 6, 2016 at 11:37 AM, 苏士涛 <tinnnysu@gmail.com> wrote:

I am new to PostgreSQL, and i have a question about streaming
replication. If i enable some extension on master with or without
native code(in c), do I need to enable this extension on slave? Or
PostgreSQL sync this automatic. Same to settings in postgresql.conf.

You don't need to enable it on the slave. The command CREATE EXTENSION
generates some WAL, so it would get replayed on the standby node as
well. If you are using synchronous_standby_names, you are sure as well
that the WAL of this CREATE EXTENSION command has been flushed to disk
on the standby, so it would not be lost in case of a master crash.
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Guillaume Lelarge
guillaume@lelarge.info
In reply to: Michael Paquier (#2)
Re: How sync settings or extensions in streaming replication

Le 6 juil. 2016 4:48 AM, "Michael Paquier" <michael.paquier@gmail.com> a
écrit :

On Wed, Jul 6, 2016 at 11:37 AM, 苏士涛 <tinnnysu@gmail.com> wrote:

I am new to PostgreSQL, and i have a question about streaming
replication. If i enable some extension on master with or without
native code(in c), do I need to enable this extension on slave? Or
PostgreSQL sync this automatic. Same to settings in postgresql.conf.

You don't need to enable it on the slave. The command CREATE EXTENSION
generates some WAL, so it would get replayed on the standby node as
well. If you are using synchronous_standby_names, you are sure as well
that the WAL of this CREATE EXTENSION command has been flushed to disk
on the standby, so it would not be lost in case of a master crash.

Before enabling the extension on the master, you should make sure it's
installed on both servers (I mean the so or dll library).

And changes to the settings in the *.conf files are not propagated.