Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit751b8d2

Browse files
committed
pg_basebackup: Allow client-side LZ4 (de)compression.
LZ4 compression can now be performed on the client usingpg_basebackup -Ft --compress client-lz4, and LZ4 decompression ofa backup compressed on the server can be performed on the clientusing pg_basebackup -Fp --compress server-lz4.Dipesh Pandit, reviewed and tested by Jeevan Ladhe and Tushar Ahuja,with a few corrections - and some documentation - by me.Discussion:http://postgr.es/m/CAN1g5_FeDmiA9D8wdG2W6Lkq5CpubxOAqTmd2et9hsinTJtsMQ@mail.gmail.com
1 parentdab2984 commit751b8d2

File tree

8 files changed

+606
-19
lines changed

8 files changed

+606
-19
lines changed

‎doc/src/sgml/ref/pg_basebackup.sgml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,14 @@ PostgreSQL documentation
417417
specify <literal>-Xfetch</literal>.
418418
</para>
419419
<para>
420-
The compression method can be set to <literal>gzip</literal> for
421-
compression with <application>gzip</application>, or
422-
<literal>lz4</literal> for compression with
423-
<application>lz4</application>, or <literal>none</literal> for no
424-
compression. However, <literal>lz4</literal> can be currently only
425-
used with <literal>server</literal>. A compression level can be
426-
optionally specified, by appending the level number after a
427-
colon (<literal>:</literal>). If no level is specified, the default
428-
compression level will be used. If only a level is specified without
429-
mentioning an algorithm, <literal>gzip</literal> compression will
430-
be used if the level is greater than 0, and no compression will be
431-
used if the level is 0.
420+
The compression method can be set to <literal>gzip</literal> or
421+
<literal>lz4</literal>, or <literal>none</literal> for no
422+
compression. A compression level can be optionally specified, by
423+
appending the level number after a colon (<literal>:</literal>). If no
424+
level is specified, the default compression level will be used. If
425+
only a level is specified without mentioning an algorithm,
426+
<literal>gzip</literal> compression will be used if the level is
427+
greater than 0, and no compression will be used if the level is 0.
432428
</para>
433429
<para>
434430
When the tar format is used with <literal>gzip</literal> or
@@ -439,6 +435,13 @@ PostgreSQL documentation
439435
compression. If this is done, the server will compress the backup for
440436
transmission, and the client will decompress and extract it.
441437
</para>
438+
<para>
439+
When this option is used in combination with
440+
<literal>-Xstream</literal>, <literal>pg_wal.tar</literal> will
441+
be compressed using <literal>gzip</literal> if client-side gzip
442+
compression is selected, but will not be compressed if server-side
443+
compresion or LZ4 compresion is selected.
444+
</para>
442445
</listitem>
443446
</varlistentry>
444447
</variablelist>

‎src/bin/pg_basebackup/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ BBOBJS = \
4343
bbstreamer_file.o\
4444
bbstreamer_gzip.o\
4545
bbstreamer_inject.o\
46+
bbstreamer_lz4.o\
4647
bbstreamer_tar.o
4748

4849
all: pg_basebackup pg_receivewal pg_recvlogical

‎src/bin/pg_basebackup/bbstreamer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ extern bbstreamer *bbstreamer_extractor_new(const char *basepath,
206206
void (*report_output_file) (constchar*));
207207

208208
externbbstreamer*bbstreamer_gzip_decompressor_new(bbstreamer*next);
209+
externbbstreamer*bbstreamer_lz4_compressor_new(bbstreamer*next,
210+
intcompresslevel);
211+
externbbstreamer*bbstreamer_lz4_decompressor_new(bbstreamer*next);
209212
externbbstreamer*bbstreamer_tar_parser_new(bbstreamer*next);
210213
externbbstreamer*bbstreamer_tar_terminator_new(bbstreamer*next);
211214
externbbstreamer*bbstreamer_tar_archiver_new(bbstreamer*next);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp