diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2021-03-29 18:34:39 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2021-03-29 18:34:39 -0300 |
commit | f50dc2c725fd546b994f228101211ae50e6858e5 (patch) | |
tree | ae5bdf9c52fa9e45ddbeafbcd5af4f5a0a0b80e6 /src | |
parent | 092d3db05d34e2cd122b066cc61c139e7b90d635 (diff) | |
download | postgresql-f50dc2c725fd546b994f228101211ae50e6858e5.tar.gz postgresql-f50dc2c725fd546b994f228101211ae50e6858e5.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/fe_utils/print.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c index 66a50f183f5..f3c176aa555 100644 --- a/src/fe_utils/print.c +++ b/src/fe_utils/print.c @@ -3347,6 +3347,9 @@ printTable(const printTableContent *cont, is_local_pager = is_pager; } + /* clear any pre-existing error indication on the output stream */ + clearerr(fout); + /* print the stuff */ if (flog) |