Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4a6de74

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 5c013e6 commit 4a6de74

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)