For this recipe, 192.168.56.30 will remain our subscriber. Follow these instructions to copy the pgbench tables and all future changes from pg1 to pg2:
- Extract the table creation statements from the primary database with the following command as the postgres user:
pg_dump -s -t 'pgbench*' postgres > /tmp/tables.sql
- Create the empty tables on the subscriber node by executing this command as the postgres user on the primary node:
psql -U rep_user -h 192.168.56.30 -f /tmp/tables.sql postgres
- Confirm that the tables exist on the subscriber node by executing the following SQL statement on that system:
SELECT schemaname, tablename FROM pg_tables WHERE tablename LIKE 'pgbench%';
- Create a file named pgbench_set.slonik ...