1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

pgbench: Improve error-handling in pgbench.

Previously failures of initial connection and logfile open caused pgbench
to proceed the benchmarking, report the incomplete results and exit with
status 2. It didn't make sense to proceed the benchmarking even when
pgbench could not start as prescribed.

This commit improves pgbench so that early errors that occur when
starting benchmark such as those failures should make pgbench exit
immediately with status 1.

Author: Yugo Nagata
Reviewed-by: Fabien COELHO, Kyotaro Horiguchi, Fujii Masao
Discussion: https://postgr.es/m/TYCPR01MB5870057375ACA8A73099C649F5349@TYCPR01MB5870.jpnprd01.prod.outlook.com
This commit is contained in:
Fujii Masao
2021-11-02 22:49:57 +09:00
parent 335397456b
commit cd29be5459
2 changed files with 21 additions and 15 deletions

View File

@ -904,10 +904,12 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
<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.
problems such as invalid command-line options or internal errors which
are supposed to never occur. Early errors that occur when starting
benchmark such as initial connection failures also exit with status 1.
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>