↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / Configuration Parameters

max_standby_archive_delay

When hot standby is active, this parameter determines how long the standby server should wait before canceling standby queries that conflict with about-to-be-applied WAL entries, as described in Section 26.4.2. max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). If this value is specified without units, it is taken as milliseconds. The default is 30 seconds. A value of -1 allows the standby to wait forever for conflicting queries to complete. This parameter can only be set in the postgresql.conf file or on the server command line. Note that max_standby_archive_delay is not the same as the maximum length of time a query can run before cancellation; rather it is the maximum total time allowed to apply any one WAL segment's data. Thus, if one query has resulted in significant delay earlier in the WAL segment, subsequent conflicting queries will have much less grace time.

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
30000
category
Replication / Standby Servers
context
sighup
doc same as
Unknown
documented
true
enumvals
Unknown
extra desc
-1 means wait forever.
lang
en
max val
2147483647
metadata version
18
min val
-1
name
max_standby_archive_delay
short desc
Sets the maximum delay before canceling queries when a hot standby server is processing archived WAL data.
source
pg-settings-source-snapshot
unit
ms
vartype
integer

Definition PG 18

When hot standby is active, this parameter determines how long the standby server should wait before canceling standby queries that conflict with about-to-be-applied WAL entries, as described in Section 26.4.2. max_standby_archive_delay applies when WAL data is being read from WAL archive (and is therefore not current). If this value is specified without units, it is taken as milliseconds. The default is 30 seconds. A value of -1 allows the standby to wait forever for conflicting queries to complete. This parameter can only be set in the postgresql.conf file or on the server command line.

Note that max_standby_archive_delay is not the same as the maximum length of time a query can run before cancellation; rather it is the maximum total time allowed to apply any one WAL segment's data. Thus, if one query has resulted in significant delay earlier in the WAL segment, subsequent conflicting queries will have much less grace time.

Compare versions

Complete source facts

doc html

<p>
        When hot standby is active, this parameter determines how long the
        standby server should wait before canceling standby queries that
        conflict with about-to-be-applied WAL entries, as described in
        <a class="xref" href="/docs/18/hot-standby.html#HOT-STANDBY-CONFLICT" title="26.4.2. Handling Query Conflicts">Section 26.4.2</a>.
        <code class="varname">max_standby_archive_delay</code> applies when WAL data is
        being read from WAL archive (and is therefore not current).
        If this value is specified without units, it is taken as milliseconds.
        The default is 30 seconds.
        A value of -1 allows the standby to wait forever for conflicting
        queries to complete.
        This parameter can only be set in the <code class="filename">postgresql.conf</code>
        file or on the server command line.
       </p><p>
        Note that <code class="varname">max_standby_archive_delay</code> is not the same as the
        maximum length of time a query can run before cancellation; rather it
        is the maximum total time allowed to apply any one WAL segment's data.
        Thus, if one query has resulted in significant delay earlier in the
        WAL segment, subsequent conflicting queries will have much less grace
        time.
       </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:614fb0942dd91fa7a15c36a9b589b71b0fb62bc79593e14bbfdbc9327efa9ac8

Text language: en · wiki-repair-20261023:614fb0942dd91fa7a15c36a9b589b71b0fb62bc79593e14bbfdbc9327efa9ac8