↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / Configuration Parameters

max_slot_wal_keep_size

Specify the maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. If max_slot_wal_keep_size is -1 (the default), replication slots may retain an unlimited amount of WAL files. Otherwise, if restart_lsn of a replication slot falls behind the current LSN by more than the given size, the standby using the slot may no longer be able to continue replication due to removal of required WAL files. You can see the WAL availability of replication slots in pg_replication_slots. If this value is specified without units, it is taken as megabytes. This parameter can only be set in the postgresql.conf file or on the server command line.

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
-1
category
Replication / Sending Servers
context
sighup
doc same as
Unknown
documented
true
enumvals
Unknown
extra desc
Replication slots will be marked as failed, and segments released for deletion or recycling, if this much space is occupied by WAL on disk. -1 means no maximum.
lang
en
max val
2147483647
metadata version
18
min val
-1
name
max_slot_wal_keep_size
short desc
Sets the maximum WAL size that can be reserved by replication slots.
source
pg-settings-source-snapshot
unit
MB
vartype
integer

Definition PG 18

Specify the maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. If max_slot_wal_keep_size is -1 (the default), replication slots may retain an unlimited amount of WAL files. Otherwise, if restart_lsn of a replication slot falls behind the current LSN by more than the given size, the standby using the slot may no longer be able to continue replication due to removal of required WAL files. You can see the WAL availability of replication slots in pg_replication_slots. If this value is specified without units, it is taken as megabytes. This parameter can only be set in the postgresql.conf file or on the server command line.

Compare versions

Complete source facts

doc html

<p>
        Specify the maximum size of WAL files
        that <a class="link" href="/docs/18/warm-standby.html#STREAMING-REPLICATION-SLOTS" title="26.2.6. Replication Slots">replication
        slots</a> are allowed to retain in the <code class="filename">pg_wal</code>
        directory at checkpoint time.
        If <code class="varname">max_slot_wal_keep_size</code> is -1 (the default),
        replication slots may retain an unlimited amount of WAL files.  Otherwise, if
        restart_lsn of a replication slot falls behind the current LSN by more
        than the given size, the standby using the slot may no longer be able
        to continue replication due to removal of required WAL files. You
        can see the WAL availability of replication slots
        in <a class="link" href="/docs/18/view-pg-replication-slots.html" title="53.20. pg_replication_slots">pg_replication_slots</a>.
        If this value is specified without units, it is taken as megabytes.
        This parameter can only be set in the <code class="filename">postgresql.conf</code>
        file or on the server command line.
       </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:86c755e7feca9ed7830bf391052174988b6df1f73bcc0aacb9ef39d410f8ca82

Text language: en · wiki-repair-20261023:86c755e7feca9ed7830bf391052174988b6df1f73bcc0aacb9ef39d410f8ca82