Re: trivial improvement to system_or_bail

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: trivial improvement to system_or_bail
Date: 2021-06-30 15:45:27
Message-ID: 608961.1625067927@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2021-06-30 15:47:19 Re: Dependency to logging in jsonapi.c
Previous Message Daniel Gustafsson 2021-06-30 15:36:34 Re: trivial improvement to system_or_bail