Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 51891d5

Browse files
committed
pg_basebackup: Cleaner handling when compression is multiply specified.
Tushar Ahuja discovered that if you use both --compress and --gzip, or --compress multiple times, the last instance of one of these options doesn't in all cases overwrite the compression level set by an earlier option. That's not a serious bug, but it also has nothing to recommend it. Repair. Discussion: http://postgr.es/m/CA+TgmoZfP=rsZB_9vDGfhuNgSu_M_09UWu8SjvsP65y_1pQFCg@mail.gmail.com
1 parent da505ea commit 51891d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,12 @@ parse_compress_options(char *src, WalCompressionMethod *methodres,
966966
int firstlen;
967967
char *firstpart;
968968

969+
/*
970+
* clear 'levelres' so that if there are multiple compression options,
971+
* the last one fully overrides the earlier ones
972+
*/
973+
*levelres = 0;
974+
969975
/* check if the option is split in two */
970976
sep = strchr(src, ':');
971977

0 commit comments

Comments
 (0)