How it works...
We start by changing a handful of configuration settings. The two lines in pg_hba.conf ensure that the rep_user user can connect to both the replication stream on the origin server, along with any database we might want to use as a source for table replication.
The other settings are for postgresql.conf, and if you followed the Configuration – getting it right the first time recipe in Chapter 3, Minimizing Downtime, on configuration, you should already have all of these set properly. We change wal_level to logical because that's a requirement to use logical replication in PostgreSQL. The previous replica setting is only suitable for standard streaming replication.
We also need to increase max_replication_slots if it is a low ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access