From 5b75a4f8266a4f187a47929fed0582ee778c703f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 9 Oct 2018 12:04:04 +0200 Subject: 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 --- doc/src/sgml/ref/pgbench.sgml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 8c464c9d421..b5e3a62a339 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -804,6 +804,18 @@ pgbench options d + + Exit Status + + + 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, pgbench will print partial + results. + + + Notes -- cgit v1.2.3