Optionally specifies an existing replication slot to be used when connecting to the sending server via streaming replication to control resource removal on the upstream node (see streaming_replication_slots).
At a glance
| Property | Value |
|---|---|
| Parameter | primary_slot_name |
| Category | Replication |
| Default | (see documentation) |
| Value type | string |
| Change scope | Reload (postgresql.conf, SIGHUP) |
| Available in | PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12) |
What it does
Optionally specifies an existing replication slot to be used when connecting to the sending server via streaming replication to control resource removal on the upstream node (see streaming_replication_slots). This parameter can only be set in the postgresql.conf file or on the server command line. If this parameter is changed while the WAL receiver process is running, that process is signaled to shut down and expected to restart with the new setting. This setting has no effect if primary_conninfo is not set or the server is not in standby mode. The name cannot be pg_conflict_detection as it is reserved for the conflict detection slot.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Set it in postgresql.conf (or with ALTER SYSTEM) and reload with SELECT pg_reload_conf(); or pg_ctl reload — no restart needed.
Inspect the current value and source with SHOW primary_slot_name; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'primary_slot_name';.
Tuning guidance
Set it so the standby uses a named physical slot on the primary, guaranteeing the primary retains WAL the standby still needs; pair with max_slot_wal_keep_size so a stalled standby cannot fill the primary’s disk.