]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Exit after fatal errors in client-side compression code.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 5 Mar 2026 19:43:21 +0000 (14:43 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 5 Mar 2026 19:43:21 +0000 (14:43 -0500)
commit8b198b093fd2ccc2712f6b5a43665818310698f4
tree8b298903be51c8bd7aac9c5b212697fc49f8b880
parent2dcac93c00655cc62e8105dc12b6cd302d2c0625
Exit after fatal errors in client-side compression code.

It looks like whoever wrote the astreamer (nee bbstreamer) code
thought that pg_log_error() is equivalent to elog(ERROR), but
it's not; it just prints a message.  So all these places tried to
continue on after a compression or decompression error return,
with the inevitable result being garbage output and possibly
cascading error messages.  We should use pg_fatal() instead.

These error conditions are probably pretty unlikely in practice,
which no doubt accounts for the lack of field complaints.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/1531718.1772644615@sss.pgh.pa.us
Backpatch-through: 15
src/bin/pg_basebackup/bbstreamer_gzip.c
src/bin/pg_basebackup/bbstreamer_lz4.c
src/bin/pg_basebackup/bbstreamer_zstd.c
src/bin/pg_dump/compress_lz4.c