Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C811EB5DBDE for ; Wed, 15 Jun 2011 09:47:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 56795-10 for ; Wed, 15 Jun 2011 12:47:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 334ACB5DBC7 for ; Wed, 15 Jun 2011 09:47:08 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p5FCl7Em029003 for ; Wed, 15 Jun 2011 12:47:07 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p5FCl70O029002; Wed, 15 Jun 2011 12:47:07 GMT (envelope-from www) Date: Wed, 15 Jun 2011 12:47:07 GMT Message-Id: <201106151247.p5FCl70O029002@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6060: does not work -z option of pg_basebackup From: "Shigehiro honda" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201106/112 X-Sequence-Number: 30491 The following bug has been logged online: Bug reference: 6060 Logged by: Shigehiro honda Email address: fwif0083@mb.infoweb.ne.jp PostgreSQL version: 9.1 beta2 Operating system: Linux Description: does not work -z option of pg_basebackup Details: it seems that the -z option of pg_basebackup does not work correctly. In getopt_long() function, there is not 'z' in 3rd argument. And Z_DEFAULT_COMPRESSION are defined as (-1) in my zlib.h and it does only test (compresslevel > 0) in the code, so the command does not compress anyway. $ diff pg_basebackup.c.DIST pg_basebackup.c 267c267 < if (compresslevel > 0) --- > if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION ) 284c284 < if (compresslevel > 0) --- > if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION) 308c308 < if (compresslevel > 0) --- > if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION) 328c328 < if (compresslevel > 0) --- > if (compresslevel > 0 || compresslevel == Z_DEFAULT_COMPRESSION) 979c979 < while ((c = getopt_long(argc, argv, "D:F:l:Z:c:h:p:U:xwWvP", --- > while ((c = getopt_long(argc, argv, "D:F:l:Z:c:h:p:U:zxwWvP", 1092c1092 < if (format == 'p' && compresslevel > 0) --- > if (format == 'p' && ( compresslevel > 0|| compresslevel == Z_DEFAULT_COMPRESSION )) regards,