How it works…
Creating the subscription itself is the easy part; we simply call the create_subscription function as we did in the Copying a few tables with pglogical recipe of Chapter 7, PostgreSQL Replication. Of all possible parameters, we only need to supply the subscription_name parameter to label the subscription, and the provider_dsn parameter so pglogical knows how to contact the provider.
Observant readers may notice that we did not specify the replication_sets parameter. This is because, unlike in the chapter on replication, we did not create a subscription set. pglogical will subscribe to the default and default_insert_only sets unless told otherwise. Since that's where we placed all of the tables on the provider, pg-new should ...
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