summaryrefslogtreecommitdiff
path: root/src/bin/pg_basebackup/bbstreamer_gzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_basebackup/bbstreamer_gzip.c')
-rw-r--r--src/bin/pg_basebackup/bbstreamer_gzip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/pg_basebackup/bbstreamer_gzip.c b/src/bin/pg_basebackup/bbstreamer_gzip.c
index 1979e95639..760619fcd7 100644
--- a/src/bin/pg_basebackup/bbstreamer_gzip.c
+++ b/src/bin/pg_basebackup/bbstreamer_gzip.c
@@ -116,7 +116,8 @@ bbstreamer_gzip_writer_new(char *pathname, FILE *file,
}
}
- if (gzsetparams(streamer->gzfile, compress->level,
+ if ((compress->options & BACKUP_COMPRESSION_OPTION_LEVEL) != 0 &&
+ gzsetparams(streamer->gzfile, compress->level,
Z_DEFAULT_STRATEGY) != Z_OK)
{
pg_log_error("could not set compression level %d: %s",