mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Fix thinko coming from 000f3adf
pg_basebackup.c relies on the compression level to not be 0 to decide if
compression should be used, but 000f3adf missed the fact that the
default compression (Z_DEFAULT_COMPRESSION) is -1, which would be used
if specifying --gzip without --compress.
While on it, add some coverage for --gzip, as this is rather easy to
miss.
Reported-by: Christoph Berg
Discussion: https://postgr.es/m/YdhRDMLjabtXOnhY@msg.df7cb.de
This commit is contained in:
@@ -524,7 +524,7 @@ LogStreamerMain(logstreamer_param *param)
|
||||
stream.do_sync);
|
||||
else
|
||||
stream.walmethod = CreateWalTarMethod(param->xlog,
|
||||
(compresslevel > 0) ?
|
||||
(compresslevel != 0) ?
|
||||
COMPRESSION_GZIP : COMPRESSION_NONE,
|
||||
compresslevel,
|
||||
stream.do_sync);
|
||||
|
||||
Reference in New Issue
Block a user