psql: call clearerr() just before printing

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: f50dc2c725fd546b994f228101211ae50e6858e5
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2021-03-29T21:34:39Z
Releases: 13.3
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 b03436994bcc (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.

Files

PathChange+/−
src/fe_utils/print.c modified +3 −0