Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Gavin Sherry wrote:
>> There are various places in the backend, such as FreeFile(), where the
>> return value of fclose() is not tested.
> We are not checking fclose, probably because fclose failures are quite
> rare. Should we be concerned?
Probably. Closing a valid file descriptor in itself can't provoke any
error that I can imagine, but fclose() also implies fflush() --- so if
you have written data that hasn't yet been forced out of the stdio
buffers then out-of-disk-space is certainly a foreseeable failure.
fclose failure on an open-for-read-only file seems like Assert()
material; it "can't happen".
regards, tom lane