pgsql: Introduce a generic pg_dump compression API

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Introduce a generic pg_dump compression API
Date: 2023-02-23 17:34:25
Message-ID: E1pVFU8-000L02-RZ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2023-02-23 19:09:10 pgsql: Refactor to add pg_strcoll(), pg_strxfrm(), and variants.
Previous Message Tom Lane 2023-02-23 16:06:04 pgsql: Fix mis-handling of outer join quals generated by EquivalenceCla