From 07366183c4c222400e9fdafe20bceedc85f38a9a Mon Sep 17 00:00:00 2001 From: Arthur Zakirov Date: Tue, 30 Jan 2018 16:09:24 +0300 Subject: [PATCH] Properly check that pglz is not supported --- src/archive.c | 3 ++- src/pg_probackup.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/archive.c b/src/archive.c index ad9e6a7b..8890ccce 100644 --- a/src/archive.c +++ b/src/archive.c @@ -63,9 +63,10 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite) elog(INFO, "pg_probackup archive-push from %s to %s", absolute_wal_file_path, backup_wal_file_path); -#ifdef HAVE_LIBZ if (compress_alg == PGLZ_COMPRESS) elog(ERROR, "pglz compression is not supported"); + +#ifdef HAVE_LIBZ if (compress_alg == ZLIB_COMPRESS) is_compress = IsXLogFileName(wal_file_name); #endif diff --git a/src/pg_probackup.c b/src/pg_probackup.c index 68146c30..9540b620 100644 --- a/src/pg_probackup.c +++ b/src/pg_probackup.c @@ -410,6 +410,12 @@ main(int argc, char *argv[]) if (compress_level == 0) compress_alg = NOT_DEFINED_COMPRESS; +#ifndef HAVE_LIBZ + if ((backup_subcmd == BACKUP || backup_subcmd == ARCHIVE_PUSH) && + compress_alg == ZLIB_COMPRESS) + elog(ERROR, "This build does not support zlib compression"); +#endif + /* do actual operation */ switch (backup_subcmd) {