1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add suport for server-side LZ4 base backup compression.

LZ4 compression can be a lot faster than gzip compression, so users
may prefer it even if the compression ratio is not as good. We will
want pg_basebackup to support LZ4 compression and decompression on the
client side as well, and there is a pending patch for that, but it's
by a different author, so I am committing this part separately for
that reason.

Jeevan Ladhe, reviewed by Tushar Ahuja and by me.

Discussion: http://postgr.es/m/CANm22Cg9cArXEaYgHVZhCnzPLfqXCZLAzjwTq7Fc0quXRPfbxA@mail.gmail.com
This commit is contained in:
Robert Haas
2022-02-11 08:29:38 -05:00
parent a745b93650
commit dab298471f
9 changed files with 349 additions and 18 deletions

View File

@ -2724,8 +2724,8 @@ The commands accepted in replication mode are:
<listitem>
<para>
Instructs the server to compress the backup using the specified
method. Currently, the only supported method is
<literal>gzip</literal>.
method. Currently, the supported methods are <literal>gzip</literal>
and <literal>lz4</literal>.
</para>
</listitem>
</varlistentry>
@ -2736,7 +2736,8 @@ The commands accepted in replication mode are:
<para>
Specifies the compression level to be used. This should only be
used in conjunction with the <literal>COMPRESSION</literal> option.
The value should be an integer between 1 and 9.
For <literal>gzip</literal> the value should be an integer between 1
and 9, and for <literal>lz4</literal> it should be between 1 and 12.
</para>
</listitem>
</varlistentry>

View File

@ -417,10 +417,13 @@ PostgreSQL documentation
specify <literal>-Xfetch</literal>.
</para>
<para>
The compression method can be set to either <literal>gzip</literal>
for compression with <application>gzip</application>, or
<literal>none</literal> for no compression. A compression level
can be optionally specified, by appending the level number after a
The compression method can be set to <literal>gzip</literal> for
compression with <application>gzip</application>, or
<literal>lz4</literal> for compression with
<application>lz4</application>, or <literal>none</literal> for no
compression. However, <literal>lz4</literal> can be currently only
used with <literal>server</literal>. A compression level can be
optionally 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
@ -428,12 +431,13 @@ PostgreSQL documentation
used if the level is 0.
</para>
<para>
When the tar format is used, the suffix <filename>.gz</filename> will
automatically be added to all tar filenames. When the plain format is
used, client-side compression may not be specified, but it is
still possible to request server-side compression. If this is done,
the server will compress the backup for transmission, and the
client will decompress and extract it.
When the tar format is used with <literal>gzip</literal> or
<literal>lz4</literal>, the suffix <filename>.gz</filename> or
<filename>.lz4</filename> will automatically be added to all tar
filenames. When the plain format is used, client-side compression may
not be specified, but it is still possible to request server-side
compression. If this is done, the server will compress the backup for
transmission, and the client will decompress and extract it.
</para>
</listitem>
</varlistentry>