Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5B8331337B54 for ; Mon, 29 Nov 2010 11:49:25 -0400 (AST) 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 24061-05 for ; Mon, 29 Nov 2010 15:49:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og112.obsmtp.com (exprod7og112.obsmtp.com [64.18.2.177]) by mail.postgresql.org (Postfix) with SMTP id 4B6181335B36 for ; Mon, 29 Nov 2010 11:49:17 -0400 (AST) Received: from source ([209.85.215.171]) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKTPPLfdUsbopDBBfp6KehGdFVEpp40mow@postini.com; Mon, 29 Nov 2010 07:49:18 PST Received: by eyg5 with SMTP id 5so2984973eyg.30 for ; Mon, 29 Nov 2010 07:49:15 -0800 (PST) Received: by 10.213.32.141 with SMTP id c13mr732530ebd.70.1291045755089; Mon, 29 Nov 2010 07:49:15 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id v51sm5275710eeh.10.2010.11.29.07.49.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Nov 2010 07:49:14 -0800 (PST) Message-ID: <4CF3CB7C.8050104@enterprisedb.com> Date: Mon, 29 Nov 2010 17:49:16 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Joachim Wieland CC: Tom Lane , =?ISO-8859-1?Q?Jos=E9_Arthur_Beneta?= =?ISO-8859-1?Q?sso_Villanova?= , pgsql-hackers@postgresql.org Subject: Re: directory archive format for pg_dump References: <4CEA9F29.5060106@enterprisedb.com> <28890.1290445623@sss.pgh.pa.us> <4CEAD61A.6060207@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/1940 X-Sequence-Number: 175083 On 29.11.2010 07:11, Joachim Wieland wrote: > On Mon, Nov 22, 2010 at 3:44 PM, Heikki Linnakangas > wrote: >> * wrap long lines >> * use extern in function prototypes in header files >> * "inline" some functions like _StartDataCompressor, _EndDataCompressor, >> _DoInflate/_DoDeflate that aren't doing anything but call some other >> function. > > So here is a new round of patches. It turned out that the feature to > allow to also restore files from a different dump and with a different > compression required some changes in the compressor API. And in the > end I didn't like all the #ifdefs either and made a less #ifdef-rich > version using function pointers. The downside now is that I have > created quite a few one-line functions that Heikki doesn't like all > that much, but I assume that they are okay in this case on the grounds > that the public compressor interface is calling the private > implementation of a certain compressor. Thanks, I'll take a look. BTW, I know you wanted to have support for other compression algorithms; I think the best way to achieve that is to make it possible to specify an external command to be used for compression. pg_dump would fork() and exec() that, and pipe the data to be compressed/decompressed to stdin/stdout of the external command. We're not going to add support for every new compression algorithm that's in vogue, but generic external command support should make happy those who want it. I'd be particularly excited about using something like pbzip2, to speed up the compression on multi-core systems. That should be a separate patch, but it's something to keep in mind with these refactorings. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com