Обсуждение: pgsql: Introduce a generic pg_dump compression API

Поиск
Список
Период
Сортировка

pgsql: Introduce a generic pg_dump compression API

От
Tomas Vondra
Дата:
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e9960732a9618d5f744ff43a09622c9185798760

Modified Files
--------------
src/bin/pg_dump/Makefile              |   2 +
src/bin/pg_dump/compress_gzip.c       | 401 ++++++++++++++++++
src/bin/pg_dump/compress_gzip.h       |  24 ++
src/bin/pg_dump/compress_io.c         | 741 ++++++----------------------------
src/bin/pg_dump/compress_io.h         | 166 ++++++--
src/bin/pg_dump/compress_none.c       | 206 ++++++++++
src/bin/pg_dump/compress_none.h       |  24 ++
src/bin/pg_dump/meson.build           |   2 +
src/bin/pg_dump/pg_backup_archiver.c  |  91 +++--
src/bin/pg_dump/pg_backup_archiver.h  |   5 +-
src/bin/pg_dump/pg_backup_custom.c    |  27 +-
src/bin/pg_dump/pg_backup_directory.c |  94 ++---
src/bin/pg_dump/t/002_pg_dump.pl      |  10 +-
src/include/common/compression.h      |   4 +
src/tools/pginclude/cpluspluscheck    |   2 +
src/tools/pgindent/typedefs.list      |   2 +
16 files changed, 1050 insertions(+), 751 deletions(-)