As with all of the previous recipes 192.168.56.10 is our origin server and 192.168.56.30 will remain our replication subscriber. Execute all commands in this recipe as the postgres system user. Follow these steps to copy the sample pgbench tables:
- Extract the table creation statements from the primary node with the following command:
pg_dump -s -t 'pgbench*' postgres > /tmp/tables.sql
- Create the empty tables on the subscriber node by executing this command on the primary node:
psql -U rep_user -h 192.168.56.30 -f /tmp/tables.sql postgres
- Execute this SQL on the primary server to create a replication set:
SELECT pglogical.create_replication_set(set_name := 'pgbench', replicate_insert := TRUE, replicate_update := ...