diff options
author | Robert Haas | 2022-03-23 13:19:14 +0000 |
---|---|---|
committer | Robert Haas | 2022-03-23 13:19:14 +0000 |
commit | ffd53659c46a54a6978bcb8c4424c1e157a2c0f1 (patch) | |
tree | f06520bc72f04ebb35b643a32e7a3ee42dee5378 /doc/src | |
parent | 4a39f87acd6e681e5ded1239391d8a92645b43d6 (diff) |
Replace BASE_BACKUP COMPRESSION_LEVEL option with COMPRESSION_DETAIL.
There are more compression parameters that can be specified than just
an integer compression level, so rename the new COMPRESSION_LEVEL
option to COMPRESSION_DETAIL before it gets released. Introduce a
flexible syntax for that option to allow arbitrary options to be
specified without needing to adjust the main replication grammar,
and common code to parse it that is shared between the client and
the server.
This commit doesn't actually add any new compression parameters,
so the only user-visible change is that you can now type something
like pg_basebackup --compress gzip:level=5 instead of writing just
pg_basebackup --compress gzip:5. However, it should make it easy to
add new options. If for example gzip starts offering fries, we can
support pg_basebackup --compress gzip:level=5,fries=true for the
benefit of users who want fries with that.
Along the way, this fixes a few things in pg_basebackup so that the
pg_basebackup can be used with a server-side compression algorithm
that pg_basebackup itself does not understand. For example,
pg_basebackup --compress server-lz4 could still succeed even if
only the server and not the client has LZ4 support, provided that
the other options to pg_basebackup don't require the client to
decompress the archive.
Patch by me. Reviewed by Justin Pryzby and Dagfinn Ilmari Mannsåker.
Discussion: http://postgr.es/m/CA+TgmoYvpetyRAbbg1M8b3-iHsaN4nsgmWPjOENu5-doHuJ7fA@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/protocol.sgml | 22 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_basebackup.sgml | 25 |
2 files changed, 32 insertions, 15 deletions
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 9178c779ba9..719b947ef4e 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -2731,14 +2731,24 @@ The commands accepted in replication mode are: </varlistentry> <varlistentry> - <term><literal>COMPRESSION_LEVEL</literal> <replaceable>level</replaceable></term> + <term><literal>COMPRESSION_DETAIL</literal> <replaceable>detail</replaceable></term> <listitem> <para> - Specifies the compression level to be used. This should only be - used in conjunction with the <literal>COMPRESSION</literal> option. - For <literal>gzip</literal> the value should be an integer between 1 - and 9, for <literal>lz4</literal> between 1 and 12, and for - <literal>zstd</literal> it should be between 1 and 22. + Specifies details for the chosen compression method. This should only + be used in conjunction with the <literal>COMPRESSION</literal> + option. If the value is an integer, it specifies the compression + level. Otherwise, it should be a comma-separated list of items, + each of the form <literal>keyword</literal> or + <literal>keyword=value</literal>. Currently, the only supported + keyword is <literal>level</literal>, which sets the compression + level. + </para> + + <para> + For <literal>gzip</literal> the compression level should be an + integer between 1 and 9, for <literal>lz4</literal> an integer + between 1 and 12, and for <literal>zstd</literal> an integer + between 1 and 22. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index 4a630b59b70..d9233beb8e1 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -399,9 +399,9 @@ PostgreSQL documentation <varlistentry> <term><option>-Z <replaceable class="parameter">level</replaceable></option></term> - <term><option>-Z [{client|server}-]<replaceable class="parameter">method</replaceable></option>[:<replaceable>level</replaceable>]</term> + <term><option>-Z [{client|server}-]<replaceable class="parameter">method</replaceable>[:<replaceable>detail</replaceable>]</option></term> <term><option>--compress=<replaceable class="parameter">level</replaceable></option></term> - <term><option>--compress=[{client|server}-]<replaceable class="parameter">method</replaceable></option>[:<replaceable>level</replaceable>]</term> + <term><option>--compress=[{client|server}-]<replaceable class="parameter">method</replaceable>[:<replaceable>detail</replaceable>]</option></term> <listitem> <para> Requests compression of the backup. If <literal>client</literal> or @@ -419,13 +419,20 @@ PostgreSQL documentation <para> The compression method can be set to <literal>gzip</literal>, <literal>lz4</literal>, <literal>zstd</literal>, or - <literal>none</literal> for no compression. A compression level can - optionally be specified, by appending the level number after a colon - (<literal>:</literal>). If no level is specified, the default - compression level will be used. If only a level is specified without - mentioning an algorithm, <literal>gzip</literal> compression will be - used if the level is greater than 0, and no compression will be used if - the level is 0. + <literal>none</literal> for no compression. A compression detail + string can optionally be specified. If the detail string is an + integer, it specifies the compression level. Otherwise, it should be + a comma-separated list of items, each of the form + <literal>keyword</literal> or <literal>keyword=value</literal>. + Currently, the only supported keyword is <literal>level</literal>, + which sets the compression level. + </para> + <para> + If no compression level is specified, the default compression level + will be used. If only a level is specified without mentioning an + algorithm, <literal>gzip</literal> compression will be used if the + level is greater than 0, and no compression will be used if the level + is 0. </para> <para> When the tar format is used with <literal>gzip</literal>, |