Re: Refactoring of compression options in pg_basebackup

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Magnus Hagander <magnus@hagander.net>, Georgios Kokolatos <gkokolatos@pm.me>, Postgres hackers <pgsql-hackers@lists.postgresql.org>, Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
Date: 2022-01-19T04:27:28Z
Lists: pgsql-hackers

Attachments

On Tue, Jan 18, 2022 at 10:04:56AM -0500, Robert Haas wrote:
> I think it could make sense for you implement
> --compress=METHOD[:LEVEL], keeping -z and -Z N as synonyms for
> --compress=gzip and --compress=gzip:N, and with --compress=N being
> interpreted as --compress=gzip:N. Then I'll generalize that to
> --compress=[{client|server}-]METHOD[:LEVEL] on the other thread. I
> think we should leave it where, if you don't say either client or
> server, you get client, because that's the historical behavior.
> 
> If that doesn't work for you, please let me know what you would prefer.

WFM.  Attached is a patch that extends --compress to handle a method
with an optional compression level.  Some extra tests are added to
cover all that.

Thoughts?
--
Michael

Commits

  1. Extend the options of pg_basebackup to control compression

  2. Add TAP tests for pg_basebackup with compression

  3. Refactor tar method of walmethods.c to rely on the compression method