Subject: Different Autovacuum Settings on Master and Replica in Streaming Replication

From: Franjo Stipanovic <[email-masked]>
Date: Fri, 17 Jan 2025 15:37:34 +0100

Question regarding autovacuum settings in a PostgreSQL streaming
replication setup. Specifically, I am curious about whether it is possible
(and advisable) to have different values for the following settings on the
master and replica databases:
- autovacuum_vacuum_scale_factor
- autovacuum_analyze_scale_factor

Can the above settings be configured differently on the master and replica
databases in a streaming replication setup? I just tested this on AWS RDS
Postgres.

How would those different settings interact with replication, for example,
if I apply change on master, would it be replicated to replica and override
my replica setting?

I was expecting that this is not possible in streaming replication, only in
logical replication.

Thank you!

---

From: Tom Lane <[email-masked]>
Date: Fri, 17 Jan 2025 10:34:23 -0500

> - autovacuum_analyze_scale_factor

A streaming replica will not run vacuum on its own, as it just absorbs
the physical changes made by vacuum on the master.  Hence, it matters
not at all how you have those values set on the replica.

If the replica is promoted to master, then it will start to use
whatever settings it has (and no, postgresql.conf is not copied
by the replication infrastructure).

			regards, tom lane