pgsql: psql: Fix incorrect status code returned by \getresults

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Fix incorrect status code returned by \getresults
Date: 2025-04-19 23:16:24
Message-ID: E1u6HQ7-000rgl-2F@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

psql: Fix incorrect status code returned by \getresults

When an invalid number of results is requested for \getresults, the
status code returned by exec_command_getresults() was PSQL_CMD_SKIP_LINE
and not PSQL_CMD_ERROR.

This led to incorrect behaviors, with ON_ERROR_STOP for example.

Reported-by: Noah Misch <noah(at)leadboat(dot)com>
Discussion: https://postgr.es/m/20250415213450.1f.nmisch@google.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5ee7bd944ee812e988a7dee52613ee1c80c13579

Modified Files
--------------
src/bin/psql/command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-04-19 23:17:25 pgsql: psql: Improve descriptions of \\flush[request] in --help
Previous Message Tom Lane 2025-04-19 20:37:58 pgsql: Be more wary of corrupt data in pageinspect's heap_page_items().