fix-mistakes-found-by-tushar.patch
application/octet-stream
Filename: fix-mistakes-found-by-tushar.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 | 7 | 1 |
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 46f6f53e9b..851f03ca81 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -1871,6 +1871,12 @@ BaseBackup(void)
exit(1);
}
+ if (writerecoveryconf)
+ {
+ pg_log_error("recovery configuration cannot be written when a backup target is used");
+ exit(1);
+ }
+
AppendPlainCommandOption(&buf, use_new_option_syntax, "TABLESPACE_MAP");
if ((colon = strchr(backup_target, ':')) == NULL)
@@ -1913,7 +1919,7 @@ BaseBackup(void)
}
AppendStringCommandOption(&buf, use_new_option_syntax,
"COMPRESSION", compressmethodstr);
- if (compresslevel != 0)
+ if (compresslevel != 0 && compresslevel != Z_DEFAULT_COMPRESSION)
AppendIntegerCommandOption(&buf, use_new_option_syntax,
"COMPRESSION_LEVEL", compresslevel);
}