Re: restore_command return code behaviour

From: Jean-Christophe Arnu <jcarnu(at)gmail(dot)com>
To: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: restore_command return code behaviour
Date: 2025-07-28 15:18:59
Message-ID: CAHZmTm2zvMOd6fvP1RzY9k7SEQA2i_q2-_UD=ervw6Zvsb+vgg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Jehan-Guillaume,

Le lun. 28 juil. 2025 à 12:32, Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)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

Attachment Content-Type Size
v3-0001-add-details-on-restore-command-return-code-125.patch text/x-patch 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-07-28 15:22:49 Re: Better HINT message for "unexpected data beyond EOF"
Previous Message Frédéric Yhuel 2025-07-28 15:09:15 Re: vacuumdb changes for stats import/export