psql lacking clearerr() - Mailing list pgsql-hackers

From Alvaro Herrera
Subject psql lacking clearerr()
Date
Msg-id 20210324141141.GA3279@alvherre.pgsql
Whole thread Raw
Responses Re: psql lacking clearerr()
List pgsql-hackers
psql seems to never call clearerr() on its output file.  So if it gets
an error while printing a result, it'll show

could not print result table: Success

after each and every result, even though the output file isn't in error
state anymore.

It seems that the simplest fix is just to do clearerr() at the start of
printTable(), as in the attached.

I haven't been able to find a good reproducer.  Sometimes doing C-s C-c
does it, but I'm not sure it is fully reproducible.

-- 
Álvaro Herrera       Valdivia, Chile

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: shared memory stats: high level design decisions: consistency, dropping
Next
From: Tom Lane
Date:
Subject: Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb