Re: trivial improvement to system_or_bail - Mailing list pgsql-hackers

From Tom Lane
Subject Re: trivial improvement to system_or_bail
Date
Msg-id 608961.1625067927@sss.pgh.pa.us
Whole thread Raw
In response to trivial improvement to system_or_bail  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: trivial improvement to system_or_bail
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> When PostgresNode::system_or_bail() fails, it's quite opaque as to what
> is happening.  This patch improves things by printing some detail, as
> suggested in Perl's doc for system().

+1 for adding the extra details, but another thing that I've always found
very confusing is just the phrasing of the message itself.  It makes
no sense unless (a) you know that "system" is Perl's function for
executing a shell command, (b) you are familiar with Perl's generally
cavalier approach to parentheses, and (c) you are also unbothered by
whether the word "failed" is part of the message text or the command
being complained of.  We really need to do something to set off the
shell command's text from the surrounding verbiage a little better.

I'd prefer something like

    command "pg_ctl start" failed: details here

            regards, tom lane



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: trivial improvement to system_or_bail
Next
From: Jacob Champion
Date:
Subject: Re: Dependency to logging in jsonapi.c