aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/basebackup_gzip.c3
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c14
2 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/replication/basebackup_gzip.c b/src/backend/replication/basebackup_gzip.c
index 703a91ba776..e4df57b121f 100644
--- a/src/backend/replication/basebackup_gzip.c
+++ b/src/backend/replication/basebackup_gzip.c
@@ -61,8 +61,6 @@ const bbsink_ops bbsink_gzip_ops = {
bbsink *
bbsink_gzip_new(bbsink *next, bc_specification *compress)
{
- int compresslevel;
-
#ifndef HAVE_LIBZ
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
@@ -70,6 +68,7 @@ bbsink_gzip_new(bbsink *next, bc_specification *compress)
return NULL; /* keep compiler quiet */
#else
bbsink_gzip *sink;
+ int compresslevel;
Assert(next != NULL);
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 3e6977df1aa..ed8d084d629 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -541,12 +541,12 @@ typedef struct
char xlog[MAXPGPATH]; /* directory or tarfile depending on mode */
char *sysidentifier;
int timeline;
+ WalCompressionMethod wal_compress_method;
+ int wal_compress_level;
} logstreamer_param;
static int
-LogStreamerMain(logstreamer_param *param,
- WalCompressionMethod wal_compress_method,
- int wal_compress_level)
+LogStreamerMain(logstreamer_param *param)
{
StreamCtl stream;
@@ -575,8 +575,8 @@ LogStreamerMain(logstreamer_param *param,
stream.do_sync);
else
stream.walmethod = CreateWalTarMethod(param->xlog,
- wal_compress_method,
- wal_compress_level,
+ param->wal_compress_method,
+ param->wal_compress_level,
stream.do_sync);
if (!ReceiveXlogStream(param->bgconn, &stream))
@@ -634,6 +634,8 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier,
param = pg_malloc0(sizeof(logstreamer_param));
param->timeline = timeline;
param->sysidentifier = sysidentifier;
+ param->wal_compress_method = wal_compress_method;
+ param->wal_compress_level = wal_compress_level;
/* Convert the starting position */
if (sscanf(startpos, "%X/%X", &hi, &lo) != 2)
@@ -724,7 +726,7 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier,
int ret;
/* in child process */
- ret = LogStreamerMain(param, wal_compress_method, wal_compress_level);
+ ret = LogStreamerMain(param);
/* temp debugging aid to analyze 019_replslot_limit failures */
if (verbose)