Skip to content

Commit 2598b76

Browse files
committed
psql: Fix exit status when query is canceled
Because of a small thinko in 7844c99, 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.
1 parent 6cc6619 commit 2598b76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/psql/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ SendQuery(const char *query)
11141114
pset.crosstab_flag || !is_select_command(query))
11151115
{
11161116
/* Default fetch-it-all-and-print mode */
1117-
OK = (ExecQueryAndProcessResults(query, &elapsed_msec, &svpt_gone, false, NULL, NULL) >= 0);
1117+
OK = (ExecQueryAndProcessResults(query, &elapsed_msec, &svpt_gone, false, NULL, NULL) > 0);
11181118
}
11191119
else
11201120
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy