]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Make GUC wal_receiver_timeout user-settable.
authorFujii Masao <fujii@postgresql.org>
Thu, 19 Feb 2026 15:52:43 +0000 (00:52 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 19 Feb 2026 15:52:43 +0000 (00:52 +0900)
When multiple subscribers connect to different publisher servers,
it can be useful to set different wal_receiver_timeout values for
each connection to better detect failures. However, previously
this wasn't possible, which limited flexibility in managing subscriptions.

This commit changes wal_receiver_timeout to be user-settable,
allowing different values to be assigned using ALTER ROLE SET for
each subscription owner. This effectively enables per-subscription
configuration.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/a1414b64-bf58-43a6-8494-9704975a41e9@oss.nttdata.com

doc/src/sgml/config.sgml
src/backend/utils/misc/guc_parameters.dat

index faf0bdb62aaceda203048847b473e32ed698e323..20dbcaeb3eeb273bf63b04b5719538db52d6f297 100644 (file)
@@ -5249,9 +5249,6 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
         If this value is specified without units, it is taken as milliseconds.
         The default value is 60 seconds.
         A value of zero disables the timeout mechanism.
-        This parameter can only be set in
-        the <filename>postgresql.conf</filename> file or on the server
-        command line.
        </para>
       </listitem>
      </varlistentry>
index 271c033952e35d92c0acd760f8188366f244dbe7..9507778415da1a746c0e4a2e1e7038e8b4c6584b 100644 (file)
   max => 'INT_MAX / 1000',
 },
 
-{ name => 'wal_receiver_timeout', type => 'int', context => 'PGC_SIGHUP', group => 'REPLICATION_STANDBY',
+{ name => 'wal_receiver_timeout', type => 'int', context => 'PGC_USERSET', group => 'REPLICATION_STANDBY',
   short_desc => 'Sets the maximum wait time to receive data from the sending server.',
   long_desc => '0 disables the timeout.',
   flags => 'GUC_UNIT_MS',