HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pg_recvlogical — Control PostgreSQL logical decoding streams. More information: <https://www.postgresql.org/docs/curr

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandlogicalclistreamscontroldecodingpg_recvlogicalpostgresql

Problem

How to use the pg_recvlogical command: Control PostgreSQL logical decoding streams. More information: <https://www.postgresql.org/docs/current/app-pgrecvlogical.html>.

Solution

pg_recvlogical — Control PostgreSQL logical decoding streams. More information: <https://www.postgresql.org/docs/current/app-pgrecvlogical.html>.

Create a new logical replication slot:
pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --create-slot


Start streaming changes from a logical replication slot to a file:
pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --start {{[-f|--file]}} {{filename}}


Drop a logical replication slot:
pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --drop-slot


Create a slot with two-phase commit enabled:
pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --create-slot {{[-t|--enable-two-phase]}}


Display help:
pg_recvlogical {{[-?|--help]}}

Code Snippets

Create a new logical replication slot

pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --create-slot

Start streaming changes from a logical replication slot to a file

pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --start {{[-f|--file]}} {{filename}}

Drop a logical replication slot

pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --drop-slot

Create a slot with two-phase commit enabled

pg_recvlogical {{[-d|--dbname]}} {{dbname}} {{[-S|--slot]}} {{slot_name}} --create-slot {{[-t|--enable-two-phase]}}

Display help

pg_recvlogical {{[-?|--help]}}

Context

tldr-pages: common/pg_recvlogical

Revisions (0)

No revisions yet.