Clean up some dead code in pg_dump with tar format and gzip compression
authorMichael Paquier <michael@paquier.xyz>
Thu, 31 Mar 2022 01:34:10 +0000 (10:34 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 31 Mar 2022 01:34:10 +0000 (10:34 +0900)
commit8ac4c25a05d1e491a51d5390aaae405600e8e466
treea4e0262b15357561c277438dacace61ab8e0d22a
parentf8e0d900afed933d8f5d3f189fdb141924a8e518
Clean up some dead code in pg_dump with tar format and gzip compression

Compression with gzip has never been supported in the tar format of
pg_dump since this code has been introduced in c3e18804, as the use of
buffered I/O in gzdopen() changes the file positioning that tar
requires.  The original idea behind the use of compression with the tar
mode is to be able to include compressed data files (named %u.dat.gz)
and blob files (blob_%u.dat.gz) in the tarball generated by the dump,
with toc.dat, that tracks down if compression is used in the dump,
always uncompressed.

Note that this commit removes the dump part of the code as well as the
restore part, removing any dependency to zlib in pg_backup_tar.c.  There
could be an argument behind keeping around the restore part, but this
would require one to change the internals of a tarball previously dumped
so as data and blob files are compressed with toc.dat itself changed to
track down if compression is enabled.  However, the argument about
gzdopen() still holds in the read case with pg_restore.

Removing this code simplifies future additions related to compression in
pg_dump.

Author: Georgios Kokolatos, Rachel Heaton
Discussion: https://postgr.es/m/faUNEOpts9vunEaLnmxmG-DldLSg_ql137OC3JYDmgrOMHm1RvvWY2IdBkv_CRxm5spCCb_OmKNk2T03TMm0fBEWveFF9wA1WizPuAgB7Ss=@protonmail.com
src/bin/pg_dump/pg_backup_tar.c