1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

pgbench: Report errors during run better

When an error occurs during a benchmark run, exit with a nonzero exit
code and write a message at the end.  Previously, it would just print
the error message when it happened but then proceed to print the run
summary normally and exit with status 0.  To still allow
distinguishing setup from run-time errors, we use exit status 2 for
the new state, whereas existing errors during pgbench initialization
use exit status 1.

Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
This commit is contained in:
Peter Eisentraut
2018-10-09 12:04:04 +02:00
parent 35584fd05f
commit 5b75a4f826
3 changed files with 51 additions and 29 deletions

View File

@ -804,6 +804,18 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
</refsect2>
</refsect1>
<refsect1>
<title>Exit Status</title>
<para>
A successful run will exit with status 0. Exit status 1 indicates static
problems such as invalid command-line options. Errors during the run such
as database errors or problems in the script will result in exit status 2.
In the latter case, <application>pgbench</application> will print partial
results.
</para>
</refsect1>
<refsect1>
<title>Notes</title>