psql: Fix exit status when query is canceled

Because of a small thinko in 7844c9918a,
psql -c would exit successfully when a query is canceled.  Fix this so
that it exits with a nonzero status, just like for all other errors.
This commit is contained in:
Peter Eisentraut 2022-10-22 09:41:38 +02:00
parent 6cc66197ff
commit 2598b76bf2
1 changed files with 1 additions and 1 deletions

View File

@ -1114,7 +1114,7 @@ SendQuery(const char *query)
pset.crosstab_flag || !is_select_command(query))
{
/* Default fetch-it-all-and-print mode */
OK = (ExecQueryAndProcessResults(query, &elapsed_msec, &svpt_gone, false, NULL, NULL) >= 0);
OK = (ExecQueryAndProcessResults(query, &elapsed_msec, &svpt_gone, false, NULL, NULL) > 0);
}
else
{