- bullseye 13.5-0+deb11u1
|PG_RECVLOGICAL(1)||PostgreSQL 13.5 Documentation||PG_RECVLOGICAL(1)|
pg_recvlogical - control PostgreSQL logical decoding streams
pg_recvlogical controls logical decoding replication slots and streams data from such replication slots.
It creates a replication-mode connection, so it is subject to the same constraints as pg_receivewal(1), plus those for logical replication (see Chapter 48).
pg_recvlogical has no equivalent to the logical decoding SQL interface's peek and get modes. It sends replay confirmations for data lazily as it receives it and on clean exit. To examine pending data on a slot without consuming it, use pg_logical_slot_peek_changes.
At least one of the following options must be specified to select an action:
The stream format is determined by the output plugin specified when the slot was created.
The connection must be to the same database used to create the slot.
--create-slot and --start can be specified together. --drop-slot cannot be combined with another action.
The following command-line options control the location and format of the output and other replication behavior:
If there's a record with LSN exactly equal to lsn, the record will be output.
The --endpos option is not aware of transaction boundaries and may truncate output partway through a transaction. Any partially output transaction will not be consumed and will be replayed again when the slot is next read from. Individual messages are never truncated.
The server will occasionally request the client to perform a flush and report the flush position to the server. This setting is in addition to that, to perform flushes more frequently.
Specifying an interval of 0 disables issuing fsync() calls altogether, while still reporting progress to the server. In this case, data could be lost in the event of a crash.
The following command-line options control the database connection parameters.
This option is never essential, since pg_recvlogical will automatically prompt for a password if the server demands password authentication. However, pg_recvlogical will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.
The following additional options are available:
This utility, like most other PostgreSQL utilities, uses the environment variables supported by libpq (see Section 33.14).
The environment variable PG_COLOR specifies whether to use color in diagnostic messages. Possible values are always, auto and never.
pg_recvlogical will preserve group permissions on the received WAL files if group permissions are enabled on the source cluster.
See Section 48.1 for an example.