pgsql: psql: call clearerr() just before printing

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: call clearerr() just before printing
Date: 2021-03-29 21:45:48
Message-ID: E1lQzhk-0002w2-MN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8d645a116ef6e04bfb03e259149b8e163dbdf50c

Modified Files
--------------
src/fe_utils/print.c | 3 +++
1 file changed, 3 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2021-03-30 02:42:25 Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
Previous Message David Rowley 2021-03-29 21:17:41 pgsql: Adjust design of per-worker parallel seqscan data struct