diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index ab252d9fc74..5ca9de63fa3 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -1188,10 +1188,8 @@ pgbench options d
-
- \gset [prefix]
- \aset [prefix]
-
+ \gset [prefix]
+ \aset [prefix]
@@ -1203,16 +1201,17 @@ pgbench options d
When the \gset command is used, the preceding SQL query is
expected to return one row, the columns of which are stored into variables
named after column names, and prefixed with prefix
- if provided.
+ if provided. If the query returns zero or multiple rows, an error is raised.
When the \aset command is used, all combined SQL queries
(separated by \;) have their columns stored into variables
named after column names, and prefixed with prefix
- if provided. If a query returns no row, no assignment is made and the variable
- can be tested for existence to detect this. If a query returns more than one
- row, the last value is kept.
+ if provided. If a query returns no rows, no assignment is made.
+ This can be detected by initializing the variable beforehand with
+ a value the query cannot return, then checking whether it changes.
+ If a query returns more than one row, the last values is kept.