pg_recvlogical

receives logical replication changes

TLDR

Start logical replication
$ pg_recvlogical -d [database] -S [slot] --start -f -
Create slot
$ pg_recvlogical -d [database] -S [slot] --create-slot -P [plugin]
Drop slot
$ pg_recvlogical -d [database] -S [slot] --drop-slot

SYNOPSIS

pg_recvlogical [options]

DESCRIPTION

pg_recvlogical receives logical replication changes. Streams decoded changes from logical replication slot. Useful for change data capture and debugging.

PARAMETERS

-d, --dbname name

Database name.
-S, --slot name
Replication slot.
--start
Start replication.
--create-slot
Create slot.
--drop-slot
Drop slot.
-P, --plugin name
Output plugin.
-f, --file file
Output file (- for stdout).

INSTALL

sudo apk add postgresql17-client

SEE ALSO

pg_receivewal(1)