Configuration parameter

wal_sender_shutdown_timeout — PostgreSQL configuration parameter

Category Replication

Specifies the maximum time the server waits during shutdown for all WAL data to be replicated to the receiver.

At a glance

Property Value
Parameter wal_sender_shutdown_timeout
Category Replication
Default (see documentation)
Value type integer
Change scope Per-session (SET)
Available in PostgreSQL 19 (added in 19)

What it does

Specifies the maximum time the server waits during shutdown for all WAL data to be replicated to the receiver. If this value is specified without units, it is taken as milliseconds. A value of -1 (the default) disables the timeout mechanism.

When replication is in use, the sending server normally waits until all WAL data has been transferred to the receiver before completing shutdown. This helps keep sender and receiver in sync after shutdown, which is especially important for physical replication switchovers, but it can delay shutdown.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW wal_sender_shutdown_timeout; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'wal_sender_shutdown_timeout';.

Tuning guidance

This parameter is rarely a performance lever. Leave it at the default unless you have a specific, documented reason to change it, change it on one session or one role/database first, and confirm the effect with pg_settings and your own measurements before rolling it out cluster-wide.

Reference

PostgreSQL documentation — wal_sender_shutdown_timeout.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters