Skip to content

Commit 8d645a1

Browse files
committed
psql: call clearerr() just before printing
We were never doing clearerr() on the output stream, which results in a message being printed after each result once an EOF is seen: could not print result table: Success This message was added by commit b034369 (in the pg13 era); before that, the error indicator would never be examined. So backpatch only that far back, even though the actual bug (to wit: the fact that the error indicator is never cleared) is older.
1 parent af52770 commit 8d645a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fe_utils/print.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,9 @@ printTable(const printTableContent *cont,
33313331
is_local_pager = is_pager;
33323332
}
33333333

3334+
/* clear any pre-existing error indication on the output stream */
3335+
clearerr(fout);
3336+
33343337
/* print the stuff */
33353338

33363339
if (flog)

0 commit comments

Comments
 (0)