Creating the Replication Slot

Replication is described using a replication slot object created on the primary instance. cd to the docker directory in Rideshare.

From there, run the following command to create the rideshare_slot replication slot on db01:

 cd docker
 
 sh db01_create_replication_slot.sh

If that ran correctly, you’ll see output like this, showing the slot named rideshare_slot was created:

  pg_create_physical_replication_slot
 -------------------------------------
  (rideshare_slot,)

If the slot already exists, there’s a comment in db01_create_replication_slot.sh showing how to drop it. If you’re starting over, you may wish to drop the slot.

With the replication slot created, you’re ready to use it in your pg_basebackup configuration, ...

Get High Performance PostgreSQL for Rails 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.