select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS

pg_copy_logical_replication_slot

Read PG 18 manual ↗

Copies an existing logical replication slot named src_slot_name to a logical replication slot named dst_slot_name, optionally changing the output plugin and persistence.

Signatures & examples

pg_copy_logical_replication_slot ( src_slot_name name, dst_slot_name name [, temporary boolean [, plugin name ]] ) → record ( slot_name name, lsn pg_lsn )
Copies an existing logical replication slot named src_slot_name to a logical replication slot named dst_slot_name, optionally changing the output plugin and persistence. The copied logical slot starts from the same LSN as the source logical slot. Both temporary and plugin are optional; if they are omitted, the values of the source slot are used. The failover option of the source logical slot is not copied and is set to false by default. This is to avoid the risk of being unable to continue logical replication after failover to standby where the slot is being synchronized. Copy of an invalidated slot is not allowed.
Version history 5
  1. PG 18 → 19changed
  2. PG 16 → 17changed
  3. PG 15 → 16changed
  4. PG 12 → 13changed
  5. PG 11 → 12added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source