Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 743851336B42 for ; Mon, 22 Nov 2010 16:44:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 80788-09 for ; Mon, 22 Nov 2010 20:44:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og111.obsmtp.com (exprod7og111.obsmtp.com [64.18.2.175]) by mail.postgresql.org (Postfix) with SMTP id 709E61337B6C for ; Mon, 22 Nov 2010 16:44:15 -0400 (AST) Received: from source ([209.85.215.172]) by exprod7ob111.postini.com ([64.18.6.12]) with SMTP ID DSNKTOrWHhthyN8/Xfiy2ypJf76LjoqrFshs@postini.com; Mon, 22 Nov 2010 12:44:16 PST Received: by eyd10 with SMTP id 10so4228204eyd.17 for ; Mon, 22 Nov 2010 12:44:13 -0800 (PST) Received: by 10.213.114.5 with SMTP id c5mr5481404ebq.39.1290458653378; Mon, 22 Nov 2010 12:44:13 -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 q58sm5015399eeh.21.2010.11.22.12.44.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Nov 2010 12:44:12 -0800 (PST) Message-ID: <4CEAD61A.6060207@enterprisedb.com> Date: Mon, 22 Nov 2010 22:44:10 +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> In-Reply-To: <28890.1290445623@sss.pgh.pa.us> 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/1482 X-Sequence-Number: 174625 On 22.11.2010 19:07, Tom Lane wrote: > Heikki Linnakangas writes: >> But I'm not actually sure we should be preventing mix& match of files >> from different dumps. It might be very useful to do just that sometimes, >> like restoring a recent backup, with the contents of one table replaced >> with older data. A warning would be ok, though. > > +1. This mechanism seems like a solution in search of a problem. > Just lose the whole thing, and instead fix pg_dump to complain if > the target directory isn't empty. That should be sufficient to guard > against accidental mixing of different dumps, and as Heikki says > there's not a good reason to prevent intentional mixing. Extending that thought a bit, it would be nice if the per-file header would carry the info if the file is compressed or not, instead of just one such flag in the TOC. You could then also mix & match files from compressed and non-compressed archives. Other than the md5 thing, the patch looks fine to me. There's many quite levels of indirection, it took me a while to get my head around the call chains like DataDumper->_WriteData->WriteDataToArchive->_WriteBuf, but I don't have any ideas on how to improve that. However, docs are missing, so I'm marking this as "Waiting on Author". There's some cosmetic changes I'd like to have fixed or do myself before committing: * 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. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com