Re: restore_command return code behaviour

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Jean-Christophe Arnu <jcarnu(at)gmail(dot)com>, Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: restore_command return code behaviour
Date: 2025-07-30 17:41:34
Message-ID: CAKFQuwbLqYx=6x+HbRU5SGs4ZzXwu42a2y-zEq-ATi7Yq+1FXw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, July 30, 2025, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
wrote:

> On Mon, Jul 28, 2025 at 3:38 PM David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> > On Monday, July 28, 2025, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)
> com> wrote:
> >> RestoreArchivedFile() has a special case for SIGTERM, though?
> >
> > I don’t see anything calling out sigterm by name.
>
> It's got a comment explaining the separate behavior, right before the
> call to wait_result_is_signal(rc, SIGTERM):
>
> https://git.postgresql.org/cgit/postgresql.git/tree/src/
> backend/access/transam/xlogarchive.c?id=412036c22d6a605340dbe397da1fb1
> 2fccd3897f#n254
>
>
Oops, I was looking at fe_utils not xlogarchive.

> > I don’t really see a point in describing the special meanings ascribed
> to 126 and 127 here since the error message will handle that should the
> need arise.
>
> I don't think Jean-Christophe's stated problem is with the server's
> error message (Jean-Christophe, please jump in and correct me) -- it's
> in knowing how to design the command so that the system behaves
> correctly. I'm not very excited about removing information at the same
> time that we're solving a lack-of-information problem. (At least not
> without consensus that the information is irrelevant, and personally I
> think the cases described so far in this thread are relevant to people
> writing these commands.)
>

Works for me. I do see the value in pointing out “command could not be
executed” behavior without referring to exit status codes. But it does
make the text longer and maybe we could centralize it somewhere by
leveraging the reference design. But acknowledge that most of them will
not have the knowledge memorized and being a bit more verbose would be a
useful shortcut for them.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-07-30 17:44:00 Re: vacuumdb changes for stats import/export
Previous Message Corey Huinker 2025-07-30 17:31:07 Re: vacuumdb changes for stats import/export