Re: BUG #18134: ROW_COUNT do not set to 0 when psql's \gset command get no rows returned

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Japin Li <japinli@hotmail.com>, amutu@amutu.com, pgsql-bugs@lists.postgresql.org
Date: 2023-10-01T00:54:22Z
Lists: pgsql-bugs
On Sat, Sep 30, 2023 at 08:44:07PM -0400, Tom Lane wrote:
> Bigger-picture question: should we back-patch this, or just fix it in
> HEAD?  It's wrong, but I'm not sure it's so obviously wrong that there
> could not be somebody depending on the existing behavior.

FWIW, I am not excited about a backpatch, so I would keep this as a
HEAD-only change.  Sure, the existing behavior is incorrect, but it
would be more annoying to break somebody's script flow after a minor
release.  And that's not critical.

(If you want to fix that yourself, please feel free.  I can do that
tomorrow by myself but life keeps me busy today and I don't have any
room to keep an eye on the buildfarm.)
--
Michael

Commits

  1. psql: Set variables from query result on failure when printing tuples