From 961bb382763e8523e79ac23ad081bc44dfab63b9 Mon Sep 17 00:00:00 2001
From: Jean-Christophe Arnu <jc.arnu@loxodata.com>
Date: Mon, 28 Jul 2025 09:49:17 +0200
Subject: [PATCH v1] add details on restore-command return code >= 128

Documentation does not mention restore_command returns codes including
128 and above. If such a code is returned, the server is shut down.
---
 doc/src/sgml/backup.sgml | 3 ++-
 doc/src/sgml/config.sgml | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml
index 5f7489afbd1..caaade3d0e3 100644
--- a/doc/src/sgml/backup.sgml
+++ b/doc/src/sgml/backup.sgml
@@ -1310,7 +1310,8 @@ restore_command = 'cp /mnt/server/archivedir/%f %p'
     a signal (other than <systemitem>SIGTERM</systemitem>, which is used as
     part of a database server shutdown) or an error by the shell (such as
     command not found), then recovery will abort and the server will not start
-    up.
+    up. However, the server will also not start if the command returns a code
+    superior or equal to 127.
    </para>
 
    <para>
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 20ccb2d6b54..548bbb33ab0 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4058,6 +4058,8 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         than <systemitem>SIGTERM</systemitem>, which is used as part of a
         database server shutdown) or an error by the shell (such as command
         not found), then recovery will abort and the server will not start up.
+        However, the server will also not start if the command returns a code
+        of 128 and above.
        </para>
 
        <para>
-- 
2.39.5

