RefLib

Reference library for AI

Back

postgresql_16:7.2.15.1 Description

PostgreSQL 16 > Reference > PostgreSQL Client Applications > pg_recvlogical > Description

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 (see postgresql_16:7.2.14), plus those for logical replication (see (see postgresql_16:6.12)).

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 (see postgresql_16:3.6.27.6).

In the absence of fatal errors, pg_recvlogical will run until terminated by the SIGINT (ControlC) or SIGTERM signal.

When pg_recvlogical receives a SIGHUP signal, it closes the current output file and opens a new one using the filename specified by the --file option. This allows us to rotate the output file by first renaming the current file and then sending a SIGHUP signal to pg_recvlogical.

Back