From abf245787746ffa7f696298d22101b4e0226f711 Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Thu, 18 Jun 2026 14:21:13 +0800
Subject: [PATCH v1] doc: Clarify pgbench reporting with --continue-on-error

Clarify that transactions failed under --continue-on-error are reported
separately and are not counted as transactions actually processed or in
TPS. Also adjust the latency description to avoid implying that failed
transactions are generally included in latency measurements.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Yugo Nagata <nagata@sraoss.co.jp>
Discussion: https://postgr.es/m/597C9755-4386-488D-A289-16D50AD81FBF@gmail.com
---
 doc/src/sgml/ref/pgbench.sgml | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 2e401d1ceb8..abdb1df6c89 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -770,10 +770,13 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
         the connection to fail.
         See <xref linkend="failures-and-retries"/> for more information.
        </para>
+
        <para>
         This option is useful when your custom script may raise errors
         such as unique constraint violations, but you want the benchmark
-        to continue and measure performance including those failures.
+        to continue despite individual statement failures.  Failed
+        transactions are reported separately, but are not counted as
+        transactions actually processed, nor are they included in TPS.
        </para>
       </listitem>
      </varlistentry>
@@ -2933,9 +2936,10 @@ statement latencies in milliseconds, failures and retries:
 
   <para>
    The latency of a successful transaction includes the entire time of
-   transaction execution with rollbacks and retries. The latency is measured
-   only for successful transactions and commands but not for failed transactions
-   or commands.
+   transaction execution with rollbacks and retries.  The latency is measured
+   only for successful transactions and commands, except that failed
+   transactions are included in the simple average latency when the
+   <option>--continue-on-error</option> option is used.
   </para>
 
   <para>
-- 
2.50.1 (Apple Git-155)

