PostgreSQL and the logical replication

Logical replication

Before the version 10 of PostgreSQL, we could only replicate the whole cluster (all the databases). As usual with PostgreSQL, everything works well but in some case, it was not very usefull (why replicate all your To of data when you only need xx Go ?).

Logical replication will allow you to replicate only certains tables. The operating principle is the following:

Choose the tables on the master you want to replicate and create a publication

On the slave, we will create a subscription

Warning: the database schema and DDL comands are not replicated. You will have to keep them in sync.