Introduce a generic pg_dump compression API
authorTomas Vondra <[email protected]>
Thu, 23 Feb 2023 17:33:30 +0000 (18:33 +0100)
committerTomas Vondra <[email protected]>
Thu, 23 Feb 2023 17:33:40 +0000 (18:33 +0100)
commite9960732a9618d5f744ff43a09622c9185798760
treeb9ea6084bbbeb947cb1921a050dbe6c9fba4a51a
parent739f1d6218f5ce1e0243127ab23f431a7d07977c
Introduce a generic pg_dump compression API

Switch pg_dump to use the Compression API, implemented by bf9aa490db.

The CompressFileHandle replaces the cfp* family of functions with a
struct of callbacks for accessing (compressed) files. This allows adding
new compression methods simply by introducing a new struct instance with
appropriate implementation of the callbacks.

Archives compressed using custom compression methods store an identifier
of the compression algorithm in their header instead of the compression
level. The header version is bumped.

Author: Georgios Kokolatos
Reviewed-by: Michael Paquier, Rachel Heaton, Justin Pryzby, Tomas Vondra
Discussion: https://postgr.es/m/faUNEOpts9vunEaLnmxmG-DldLSg_ql137OC3JYDmgrOMHm1RvvWY2IdBkv_CRxm5spCCb_OmKNk2T03TMm0fBEWveFF9wA1WizPuAgB7Ss%3D%40protonmail.com
16 files changed:
src/bin/pg_dump/Makefile
src/bin/pg_dump/compress_gzip.c [new file with mode: 0644]
src/bin/pg_dump/compress_gzip.h [new file with mode: 0644]
src/bin/pg_dump/compress_io.c
src/bin/pg_dump/compress_io.h
src/bin/pg_dump/compress_none.c [new file with mode: 0644]
src/bin/pg_dump/compress_none.h [new file with mode: 0644]
src/bin/pg_dump/meson.build
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_directory.c
src/bin/pg_dump/t/002_pg_dump.pl
src/include/common/compression.h
src/tools/pginclude/cpluspluscheck
src/tools/pgindent/typedefs.list