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:42:52 +0200 |
commit | 2598b76bf2bc78af4c65ffab4736c7b49205fc7a (patch) | |
tree | 237f27c6dcac15cf36857b9e52ac4096b0465eee /src/bin/psql/common.c | |
parent | 6cc66197ff9aa34cc47486d7bf719f376f6f5ff8 (diff) | |
download | postgresql-2598b76bf2bc78af4c65ffab4736c7b49205fc7a.tar.gz postgresql-2598b76bf2bc78af4c65ffab4736c7b49205fc7a.zip |
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.
Diffstat (limited to 'src/bin/psql/common.c')
-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 4f310a8019d..864f195992f 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 { |