Built-in logical replication and logical decoding were introduced in PostgreSQL 10. Over a period of time, more and more features are being implemented within logical replication. It is helpful when a selected list of tables needs to be replicated from multiple OLTP databases to a single OLAP database for reporting and analysis.
Logical replication is also helpful to perform replication between two major PostgreSQL versions to perform rolling-fashion upgrades. In this recipe, we shall discuss the steps involved in setting up logical replication between two PostgreSQL servers.
Getting ready...
Logical replication uses a publish and subscribe model. The node that sends the changes becomes a publisher. And the node that subscribes to those changes becomes a subscriber. There can be one or more subscriptions to a publication. We could choose what to replicate – INSERT or DELETE or UPDATE or ALL. By default, it is ALL.
It is always recommended...