As with all of the previous recipes, 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
- Add all of the pgbench tables to Bucardo with these commands:
bucardo add table pgbench_accounts db=pg1 bucardo add table pgbench_branches db=pg1 bucardo add table pgbench_tellers db=pg1
- Confirm tables are being tracked ...