From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: trivial improvement to system_or_bail
Date: Tue, 6 Jul 2021 17:59:11 -0400
Message-ID: <202107062159.mnkybjgs2u23@alvherre.pgsql> (raw)
In-Reply-To: <608961.1625067927@sss.pgh.pa.us> <8AC32042-183D-452B-9B18-AA150BC99621@yesql.se>
On 2021-Jun-30, Daniel Gustafsson wrote:
> + BAIL_OUT("system $_[0] failed: $!\n");
> I wonder if we should take more inspiration from the Perl manual and change it
> to "failed to execute" to make it clear that the failure was in executing the
> program, not from the program itself?
You're right, that's a good distinction to make. I've used this
wording. Thanks.
> +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
Done that way, thanks for the suggestion.
Failures now look like this, respectively:
Bailout called. Further testing stopped: failed to execute command "finitdb -D /home/alvherre/Code/pgsql-build/master/src/test/recovery/tmp_check/t_019_replslot_limit_primary_data/pgdata -A trust -N --wal-segsize=1": No such file or directory
Bailout called. Further testing stopped: command "initdb -0D /home/alvherre/Code/pgsql-build/master/src/test/recovery/tmp_check/t_019_replslot_limit_primary_data/pgdata -A trust -N --wal-segsize=1" exited with value 1
Bailout called. Further testing stopped: command "initdb -0D /home/alvherre/Code/pgsql-build/master/src/test/recovery/tmp_check/t_019_replslot_limit_primary_data/pgdata -A trust -N --wal-segsize=1" died with signal 11
Previously it was just
Bailout called. Further testing stopped: system initdb failed
--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/
"I must say, I am absolutely impressed with what pgsql's implementation of
VALUES allows me to do. It's kind of ridiculous how much "work" goes away in
my code. Too bad I can't do this at work (Oracle 8/9)." (Tom Allison)
http://archives.postgresql.org/pgsql-general/2007-06/msg00016.php
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, daniel@yesql.se, tgl@sss.pgh.pa.us
Subject: Re: trivial improvement to system_or_bail
In-Reply-To: <202107062159.mnkybjgs2u23@alvherre.pgsql>
References: <202107062159.mnkybjgs2u23@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox