↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / Configuration Parameters

idle_replication_slot_timeout

Invalidate replication slots that have remained inactive (not used by a replication connection) for longer than this duration. If this value is specified without units, it is taken as seconds. A value of zero (the default) disables the idle timeout invalidation mechanism. This parameter can only be set in the postgresql.conf file or on the server command line. Slot invalidation due to idle timeout occurs during checkpoint. Because checkpoints happen at checkpoint_timeout intervals, there can be some lag between when the idle_replication_slot_timeout was exceeded and when the slot invalidation is triggered at the next checkpoint. To avoid such lags, users can force a checkpoint to promptly invalidate inactive slots. The duration of slot inactivity is calculated using the slot's pg_replication_slots.inactive_since value. Note that the idle timeout invalidation mechanism is not applicable for slots that do not reserve WAL or for slots on the standby server that are being synced from the primary server (i.e., standby slots having pg_replication_slots.synced value true). Synced slots are always considered to be inactive because they don't perform logical decoding to produce changes.

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

boot val
0
category
Replication / Sending Servers
context
sighup
doc same as
Unknown
documented
true
enumvals
Unknown
extra desc
Unknown
lang
en
max val
2147483647
metadata version
18
min val
0
name
idle_replication_slot_timeout
short desc
Sets the duration a replication slot can remain idle before it is invalidated.
source
pg-settings-source-snapshot
unit
s
vartype
integer

Definition PG 18

Invalidate replication slots that have remained inactive (not used by a replication connection) for longer than this duration. If this value is specified without units, it is taken as seconds. A value of zero (the default) disables the idle timeout invalidation mechanism. This parameter can only be set in the postgresql.conf file or on the server command line.

Slot invalidation due to idle timeout occurs during checkpoint. Because checkpoints happen at checkpoint_timeout intervals, there can be some lag between when the idle_replication_slot_timeout was exceeded and when the slot invalidation is triggered at the next checkpoint. To avoid such lags, users can force a checkpoint to promptly invalidate inactive slots. The duration of slot inactivity is calculated using the slot's pg_replication_slots.inactive_since value.

Note that the idle timeout invalidation mechanism is not applicable for slots that do not reserve WAL or for slots on the standby server that are being synced from the primary server (i.e., standby slots having pg_replication_slots.synced value true). Synced slots are always considered to be inactive because they don't perform logical decoding to produce changes.

Compare versions

Complete source facts

doc html

<p>
        Invalidate replication slots that have remained inactive (not used by
        a <a class="link" href="/docs/18/protocol-replication.html" title="54.4. Streaming Replication Protocol">replication connection</a>)
        for longer than this duration.
        If this value is specified without units, it is taken as seconds.
        A value of zero (the default) disables the idle timeout
        invalidation mechanism.  This parameter can only be set in the
        <code class="filename">postgresql.conf</code> file or on the server command
        line.
       </p><p>
        Slot invalidation due to idle timeout occurs during checkpoint.
        Because checkpoints happen at <code class="varname">checkpoint_timeout</code>
        intervals, there can be some lag between when the
        <code class="varname">idle_replication_slot_timeout</code> was exceeded and when
        the slot invalidation is triggered at the next checkpoint.
        To avoid such lags, users can force a checkpoint to promptly invalidate
        inactive slots. The duration of slot inactivity is calculated using the
        slot's <a class="link" href="/docs/18/view-pg-replication-slots.html" title="53.20. pg_replication_slots">pg_replication_slots</a>.<code class="structfield">inactive_since</code>
        value.
       </p><p>
        Note that the idle timeout invalidation mechanism is not applicable
        for slots that do not reserve WAL or for slots on the standby server
        that are being synced from the primary server (i.e., standby slots
        having <a class="link" href="/docs/18/view-pg-replication-slots.html" title="53.20. pg_replication_slots">pg_replication_slots</a>.<code class="structfield">synced</code>
        value <code class="literal">true</code>). Synced slots are always considered to
        be inactive because they don't perform logical decoding to produce
        changes.
       </p>

documentation revision

{"inputs":[{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","version":"18.7"},{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"83907b5f469e979a7b9ec875b5e7bdaa2ef6b85596ca31b45174f68cd7398b18","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:7ba48fe95984da71aab7ec461fbc39a870c557d08432a2b2a843d0b7525c636f

Text language: en · wiki-repair-20261023:7ba48fe95984da71aab7ec461fbc39a870c557d08432a2b2a843d0b7525c636f