Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 140912E0052 for ; Thu, 8 May 2008 03:23:46 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59777-09 for ; Thu, 8 May 2008 03:23:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail136040.authsmtp.co.uk (outmail136040.authsmtp.co.uk [62.13.136.40]) by developer.postgresql.org (Postfix) with ESMTP id 931512E0031 for ; Thu, 8 May 2008 03:23:42 -0300 (ADT) Received: from mail-c188.authsmtp.com (mail-c188.authsmtp.com [62.13.128.25]) by punt3.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id m486Ne7r097163; Thu, 8 May 2008 07:23:40 +0100 (BST) Received: from [192.168.0.3] (85-211-73-85.dyn.gotadsl.co.uk [85.211.73.85]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m486Ndu0084564; Thu, 8 May 2008 07:23:39 +0100 (BST) Subject: Re: Backup/Restore of single table in multi TB database From: Simon Riggs To: John Smith Cc: pgsql-general@postgresql.org In-Reply-To: References: <19037.1210196461@sss.pgh.pa.us> Content-Type: text/plain Date: Thu, 08 May 2008 07:25:16 +0100 Message-Id: <1210227916.4268.254.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Server-Quench: 4c7523fd-1cc7-11dd-aecc-001871e930f4 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaA1bYFhI HGQLW1xEUFp7W2B/ aAMfZQBDYEtPQQJp TkBMXVBXCwUmXBgJ AGBKFxlyfwFDfno+ ZE5iWj5fD0N/d0Ur FlNVRj4BeGZhPDQC ARULJB5UcAJCeR4Q Y1N/AndDAzANdhEX MikeBRkVCH11IS9W XxlKF18JXUERE3Y7 SVgZHDMgGUBNWyw5 KxFuK1hUGVsVLkR6 DXFpVVsEOhUbEQA2 X-Authentic-SMTP: 61633235383639.cat.dmpriest.net.uk:953/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/253 X-Sequence-Number: 132652 On Wed, 2008-05-07 at 15:24 -0700, John Smith wrote: > Actually, I forgot to mention one more detail in my original post. > For the table that we're looking to backup, we also want to be able to > do incremental backups. pg_dump will cause the entire table to be > dumped out each time it is invoked. > > With the pg_{start,stop}_backup approach, incremental backups could be > implemented by just rsync'ing the data files for example and applying > the incremental WALs. So if table foo didn't change very much since > the first backup, we would only need to rsync a small amount of data > plus the WALs to get an incremental backup for table foo. > > Besides picking up data on unwanted tables from the WAL (e.g., bar > would appear in our recovered database even though we only wanted > foo), do you see any other problems with this pg_{start,stop}_backup > approach? Admittedly, it does seem a bit hacky. You wouldn't be the first to ask to restore only a single table. I can produce a custom version that does that if you like, though I'm not sure that feature would be accepted into the main code. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com