Hi Jehan-Guillaume, Le lun. 28 juil. 2025 à 12:32, Jehan-Guillaume de Rorthais <j...@dalibo.com> a écrit :
> 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 > + of 128 and above. > > It seems redundant with the explanation in this paragraph when you know > that a > code greater than 125 is returned on shell error or signal. > You're right. > As I'm sure you already know, this behavior is documented on the > archive_command side using these words: [...] > So I assume we could keep the same documentation style for the > restore_command > side: > > « > An exception is that if the command was terminated by a signal (other > than > SIGTERM, which is used as part of a database server shutdown) or an > error by > the shell **with an exit status greater than 125** (such as command not > found), then recovery will abort and the server will not start up. > » > > What do you think? > You're also right. That's more consistent and easier to read. Thank you for pointing this out. -- Jean-Christophe Arnu
From cbacdf8cf6809c03d714d1b968992938f3010e71 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Arnu <jc.a...@loxodata.com> Date: Mon, 28 Jul 2025 17:04:37 +0200 Subject: [PATCH v3] add details on restore-command return code > 125 Documentation does not mention restore_command returns codes greater than 125. If such a code is returned, the server is shut down. Use the same wording than archive_command as advised Jeahn-Guillaume de Rothais. --- doc/src/sgml/backup.sgml | 6 +++--- doc/src/sgml/config.sgml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 5f7489afbd1..204e1c604f9 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1308,9 +1308,9 @@ restore_command = 'cp /mnt/server/archivedir/%f %p' present in the archive; it must return nonzero when so asked. This is not an error condition. An exception is that if the command was terminated by 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. + part of a database server shutdown) or an error by the shell with an exit + status greater than 125 (such as command not found), then recovery will + abort and the server will not start up. </para> <para> diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 20ccb2d6b54..4af6c5934ae 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4056,8 +4056,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows </programlisting> An exception is that if the command was terminated by 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. + database server shutdown) or an error by the shell with an exit status + greater than 125 (such as command not found), then recovery will abort + and the server will not start up. </para> <para> -- 2.39.5