How it works...
After the last few extensions, using pglogical is almost refreshingly easy. As usual, we start by copying the pgbench table definitions from the origin node to the subscriber. Once that is done, the provider node has only one job: to create a subscription set.
The subscription set we create is named pgbench to fit the theme of copying multiple pgbench tables. When defining a replication set with the create_replication_set function, we actually have a few options that the other replication systems did not offer. We elected to only replicate INSERT and UPDATE statements in this example. In such a scenario, the origin server can delete records from the table or truncate it entirely, and the records on the subscriber will remain. ...
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