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 CAHGQGwGY+0QnDU2at3FmnX8PE_1ZXu+7m2zkwUg4augMWHsgNg@mail.gmail.com
Whole thread Raw
In response to Re: Documentation fix on pgbench \aset command  (Yugo Nagata <nagata@sraoss.co.jp>)
Responses Re: Documentation fix on pgbench \aset command
List pgsql-hackers
On Fri, Jun 27, 2025 at 10:37 AM Yugo Nagata <nagata@sraoss.co.jp> wrote:
> This will work if we assume that the query never returns the initial value.
> I've attached a updated patch that fix the documentation as below:
>
>  If a query returns no rows, no assignment is made. You can detect
>  this by initializing the variable beforehand with a value that the query is
>  assumed never to return, and then checking whether it changes.

Thanks for updating the patch!

While reviewing the descriptions for \gset and \aset, I noticed they're listed
as a single term. I think it would be clearer to list them separately.
Also, there's no explanation of what happens if the query with \gset returns
zero or multiple rows, so I'd like to add that too. Thought?

I've attached an updated version of the patch with these changes applied.

Regards,

--
Fujii Masao

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [PATCH] Introduce unified support for composite GUC options
Next
From: Michael Banck
Date:
Subject: Re: GNU/Hurd portability patches