Re: Documentation fix on pgbench \aset command

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Documentation fix on pgbench \aset command
Date: 2025-06-26 16:05:47
Message-ID: db2d736d-2360-4665-8e3c-9cfb0e78bf07@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2025-06-26 16:24:45 Re: IPC/MultixactCreation on the Standby server
Previous Message Jim Jones 2025-06-26 15:27:37 Re: Bug with concurrent CREATE OR REPLACE (?)