Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+1-1
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)