diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-10-22 09:41:38 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-10-22 09:41:38 +0200 |
commit | 4a6de748d3429cfa081942c46411d62341867bfd (patch) | |
tree | 13e3ab6cc30345cd75ac8b7d741a26273c9290f0 | |
parent | 5c013e620c911d728f653785843eb3c272c43538 (diff) |
psql: Fix exit status when query is canceled
Because of a small thinko in 7844c9918a43b494adde3575891d217a37062378,
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.
-rw-r--r-- | src/bin/psql/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 53e710e92f9..f5909f95478 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -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 { |