The attached patch fixes the case when `pg_dump -Fd …` is called on a partition where write(2) fails for some reason or
another.In this case, backup jobs were returning with a successful exit code even though most of the files in the dump
directorywere all zero length.
I haven’t tested this patch’s failure conditions but the fix seems simple enough: cfwrite() needs to have its return
statuschecked everywhere and exit_horribly() upon any failure. In this case, callers of _WriteData() were not checking
thereturn status and were discarding the negative return status (e.g. ENOSPC).
I made a cursory pass over the code and found one other instance where write status wasn’t being checked and also
includedthat.
-sc
--
Sean Chittenden
sean@chittenden.org