Getting data out of Postgres
Three approaches, ordered by how much of your schema they need to know. All of them assume a role with REPLICATION and a reachable host.
Set up a slot
One publication per destination. Naming it after the destination is what stops two syncs from quietly sharing a slot.
Slots are per-database, and the name has to be unique across the cluster.
The first read is a snapshot; everything after is the WAL stream.
Before you start
Replication slots hold WAL until they are consumed, and an abandoned slot fills the disk. See slot hygiene.What you get
- Row-level inserts, updates and deletes, in commit order.
- Schema changes as DDL events, ahead of the rows using them.
- A resumable position, so a restart picks up where it stopped.
Common questions
Does this lock the table?
What happens if the destination is down?
Can two syncs share a slot?
Next
Last reviewed March 2026