How to do it...

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:

  1. Extract the table creation statements from the primary node with the following command:
        pg_dump -s -t 'pgbench*' postgres > /tmp/tables.sql
  1. 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
  1. 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
  1. Confirm tables are being tracked ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.