On 2025/06/26 18:01, Yugo Nagata wrote:
> Hi,
>
> The current documentation of pgbench’s \aset command states:
>
> “If a query returns no row, no assignment is made and the variable
> can be tested for existence to detect this.”
>
> However, this is inaccurate, since variable existence check (like \if :{?var})
> is not yet supported, although such a feature was proposed in [1] and discussed
> again in [2], where \aset itself was introduced.
Right.
> Therefore, I’ve attached a patch to remove this part from the documentation.
Or would it be worth documenting an alternative way to detect when no rows are
returned? For example:
If a query returns no rows, no variables are assigned. You can detect
this by setting an initial value to the variable before running the query
and checking whether it changes.
Regards,
--
Fujii Masao
NTT DATA Japan Corporation