overwrite-compression-level.patch

application/octet-stream

Filename: overwrite-compression-level.patch
Type: application/octet-stream
Part: 0
Message: Re: refactoring basebackup.c

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/bin/pg_basebackup/pg_basebackup.c 6 0
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 851f03ca81..897f8982a2 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -966,6 +966,12 @@ parse_compress_options(char *src, WalCompressionMethod *methodres,
 	int			firstlen;
 	char	   *firstpart;
 
+	/*
+	 * clear 'levelres' so that if there are multiple compression options,
+	 * the last one fully overrides the earlier ones
+	 */
+	*levelres = 0;
+
 	/* check if the option is split in two */
 	sep = strchr(src, ':');