Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 49298B5D8BD for ; Wed, 15 Jun 2011 13:22:10 -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 32836-03 for ; Wed, 15 Jun 2011 16:22:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C5FEBB5D803 for ; Wed, 15 Jun 2011 13:22:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p5FGLxCj000452; Wed, 15 Jun 2011 12:21:59 -0400 (EDT) To: "Shigehiro honda" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6060: does not work -z option of pg_basebackup In-reply-to: <201106151247.p5FCl70O029002@wwwmaster.postgresql.org> References: <201106151247.p5FCl70O029002@wwwmaster.postgresql.org> Comments: In-reply-to "Shigehiro honda" message dated "Wed, 15 Jun 2011 12:47:07 +0000" Date: Wed, 15 Jun 2011 12:21:59 -0400 Message-ID: <450.1308154919@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/116 X-Sequence-Number: 30495 "Shigehiro honda" writes: > it seems that the -z option of pg_basebackup does not work correctly. > In getopt_long() function, there is not 'z' in 3rd argument. Ooops. Doesn't look like this got tested much (or at all). > 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. I think it would be sufficient to test (compresslevel != 0) in all these places, instead of hard-wiring knowledge of Z_DEFAULT_COMPRESSION. Will fix, thanks for the report! > $ diff pg_basebackup.c.DIST pg_basebackup.c BTW, plain diffs are just about useless, since patch can't apply them safely if the code has changed at all. Please send -c or -u format diffs in future. regards, tom lane