From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: amutu@amutu.com
Subject: BUG #18134: ROW_COUNT do not set to 0 when psql's \gset command get no rows returned
Date: Tue, 26 Sep 2023 01:26:14 +0000
Message-ID: <18134-87126d90cb4dd049@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18134
Logged by: amutu
Email address: amutu@amutu.com
PostgreSQL version: 15.4
Operating system: FreeBSD 13.2-RELEASE amd64
Description:
reproduce steps:
$psql postgres
psql (15.4)
Type "help" for help.
postgres=# select * from cmdq where status= 'new' \gset
no rows returned for \gset
postgres=# \echo :ROW_COUNT
:ROW_COUNT
postgres=# select * from cmdq;
cmd | src_ip | worker | status | ts | id
---------+-----------+--------+--------+-------------------------------+----
ls /tmp | 127.0.0.1 | | done | 2023-09-23 14:39:59.047309+08 |
1
(1 row)
postgres=# \echo :ROW_COUNT
1
postgres=# select * from cmdq where status= 'new' \gset
no rows returned for \gset
postgres=# \echo :ROW_COUNT
1
------------------------------------------------
from the psql doc:
ROW_COUNT
The number of rows returned or affected by the last SQL query, !!!!or 0 if
the query failed or did not report a row count.!!!!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, amutu@amutu.com
Subject: Re: BUG #18134: ROW_COUNT do not set to 0 when psql's \gset command get no rows returned
In-Reply-To: <18134-87126d90cb4dd049@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox