Re: Documentation fix on pgbench \aset command - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Documentation fix on pgbench \aset command
Date
Msg-id db2d736d-2360-4665-8e3c-9cfb0e78bf07@oss.nttdata.com
Whole thread Raw
List pgsql-hackers

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




pgsql-hackers by date:

Previous
From: Jim Jones
Date:
Subject: Re: Bug with concurrent CREATE OR REPLACE (?)
Next
From: Álvaro Herrera
Date:
Subject: Re: pg_dump misses comments on NOT NULL constraints