@@ -76,9 +76,8 @@ tps = 896.967014 (without initial connection time)
7676 and number of transactions per client); these will be equal unless the run
7777 failed before completion or some SQL command(s) failed. (In
7878 <option>-T</option> mode, only the actual number of transactions is printed.)
79- The next line reports the number of failed transactions due to
80- serialization or deadlock errors (see <xref linkend="failures-and-retries"/>
81- for more information).
79+ The next line reports the number of failed transactions (see
80+ <xref linkend="failures-and-retries"/> for more information).
8281 The last line reports the number of transactions per second.
8382 </para>
8483
@@ -759,6 +758,26 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
759758 </listitem>
760759 </varlistentry>
761760
761+ <varlistentry id="pgbench-option-continue-on-error">
762+ <term><option>--continue-on-error</option></term>
763+ <listitem>
764+ <para>
765+ Allows clients to continue running even if an SQL statement fails
766+ due to errors other than serialization or deadlock. By default,
767+ clients abort after such errors, but with this option enabled,
768+ they proceed to the next transaction instead. Note that
769+ clients still abort even with this option if an error causes
770+ the connection to fail.
771+ See <xref linkend="failures-and-retries"/> for more information.
772+ </para>
773+ <para>
774+ This option is useful when your custom script may raise errors
775+ such as unique constraint violations, but you want the benchmark
776+ to continue and measure performance including those failures.
777+ </para>
778+ </listitem>
779+ </varlistentry>
780+
762781 <varlistentry id="pgbench-option-exit-on-abort">
763782 <term><option>--exit-on-abort</option></term>
764783 <listitem>
@@ -790,6 +809,9 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
790809 <listitem>
791810 <para>deadlock failures;</para>
792811 </listitem>
812+ <listitem>
813+ <para>other failures;</para>
814+ </listitem>
793815 </itemizedlist>
794816 See <xref linkend="failures-and-retries"/> for more information.
795817 </para>
@@ -2408,8 +2430,8 @@ END;
24082430 will be reported as <literal>failed</literal>. If you use the
24092431 <option>--failures-detailed</option> option, the
24102432 <replaceable>time</replaceable> of the failed transaction will be reported as
2411- <literal>serialization</literal> or
2412- <literal>deadlock </literal> depending on the type of failure (see
2433+ <literal>serialization</literal>, <literal>deadlock</literal>, or
2434+ <literal>other </literal> depending on the type of failure (see
24132435 <xref linkend="failures-and-retries"/> for more information).
24142436 </para>
24152437
@@ -2637,6 +2659,17 @@ END;
26372659 </para>
26382660 </listitem>
26392661 </varlistentry>
2662+
2663+ <varlistentry>
2664+ <term><replaceable>other_sql_failures</replaceable></term>
2665+ <listitem>
2666+ <para>
2667+ number of transactions that got an SQL error
2668+ (zero unless both <option>--failures-detailed</option> and
2669+ <option>--continue-on-error</option> are specified)
2670+ </para>
2671+ </listitem>
2672+ </varlistentry>
26402673 </variablelist>
26412674 </para>
26422675
@@ -2645,8 +2678,8 @@ END;
26452678<screen>
26462679<userinput>pgbench --aggregate-interval=10 --time=20 --client=10 --log --rate=1000 --latency-limit=10 --failures-detailed --max-tries=10 test</userinput>
26472680
2648- 1650260552 5178 26171317 177284491527 1136 44462 2647617 7321113867 0 9866 64 7564 28340 4148 0
2649- 1650260562 4808 25573984 220121792172 1171 62083 3037380 9666800914 0 9998 598 7392 26621 4527 0
2681+ 1650260552 5178 26171317 177284491527 1136 44462 2647617 7321113867 0 9866 64 7564 28340 4148 0 0
2682+ 1650260562 4808 25573984 220121792172 1171 62083 3037380 9666800914 0 9998 598 7392 26621 4527 0 0
26502683</screen>
26512684 </para>
26522685
@@ -2850,10 +2883,20 @@ statement latencies in milliseconds, failures and retries:
28502883 <para>
28512884 A client's run is aborted in case of a serious error; for example, the
28522885 connection with the database server was lost or the end of script was reached
2853- without completing the last transaction. In addition, if execution of an SQL
2854- or meta command fails for reasons other than serialization or deadlock errors,
2855- the client is aborted. Otherwise, if an SQL command fails with serialization or
2856- deadlock errors, the client is not aborted. In such cases, the current
2886+ without completing the last transaction. The client also aborts
2887+ if a meta command fails, or if an SQL command fails for reasons other than
2888+ serialization or deadlock errors when <option>--continue-on-error</option>
2889+ is not specified. With <option>--continue-on-error</option>,
2890+ the client does not abort on such SQL errors and instead proceeds to
2891+ the next transaction. These cases are reported as
2892+ <literal>other failures</literal> in the output. If the error occurs
2893+ in a meta command, however, the client still aborts even when this option
2894+ is specified.
2895+ </para>
2896+ <para>
2897+ If an SQL command fails due to serialization or deadlock errors, the
2898+ client does not abort, regardless of whether
2899+ <option>--continue-on-error</option> is used. Instead, the current
28572900 transaction is rolled back, which also includes setting the client variables
28582901 as they were before the run of this transaction (it is assumed that one
28592902 transaction script contains only one transaction; see
0 commit comments