From dab298471ff2f91f33bc25bfb73e435d3ab02148 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 11 Feb 2022 08:29:38 -0500 Subject: 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 --- doc/src/sgml/protocol.sgml | 7 ++++--- doc/src/sgml/ref/pg_basebackup.sgml | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index fd03c860bdf..1c5ab008791 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -2724,8 +2724,8 @@ The commands accepted in replication mode are: Instructs the server to compress the backup using the specified - method. Currently, the only supported method is - gzip. + method. Currently, the supported methods are gzip + and lz4. @@ -2736,7 +2736,8 @@ The commands accepted in replication mode are: Specifies the compression level to be used. This should only be used in conjunction with the COMPRESSION option. - The value should be an integer between 1 and 9. + For gzip the value should be an integer between 1 + and 9, and for lz4 it should be between 1 and 12. diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index e7ae29ec3d3..7a1b432eba3 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -417,10 +417,13 @@ PostgreSQL documentation specify -Xfetch. - The compression method can be set to either gzip - for compression with gzip, or - none for no compression. A compression level - can be optionally specified, by appending the level number after a + The compression method can be set to gzip for + compression with gzip, or + lz4 for compression with + lz4, or none for no + compression. However, lz4 can be currently only + used with server. A compression level can be + optionally specified, by appending the level number after a colon (:). If no level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will @@ -428,12 +431,13 @@ PostgreSQL documentation used if the level is 0. - When the tar format is used, the suffix .gz 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 gzip or + lz4, the suffix .gz or + .lz4 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. -- cgit v1.2.3