Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9782863291A for ; Thu, 18 Feb 2010 18:50:05 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 13054-07 for ; Thu, 18 Feb 2010 22:49:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 4BB6763280E for ; Thu, 18 Feb 2010 18:49:53 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 18 Feb 2010 16:49:51 -0600 Message-Id: <4B7D6FA7020000250002F3DA@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 18 Feb 2010 16:49:43 -0600 From: "Kevin Grittner" To: "Brad Littlejohn" , "'pgsql-admin@postgresql.org'" Subject: Re: Apply WAL logs after database restore References: <4B7D68BF020000250002F3D4@gw.wicourts.gov> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.72 tagged_above=-10 required=5 tests=AWL=-0.610, BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 201002/142 X-Sequence-Number: 33745 Brad Littlejohn wrote: > Okay.. then let's ask this. If I take a file-based backup of the > source database now, the previous WAL logs should be irrelevant, > right? The reason I ask, is that one of my developers made a > change to 2 tables last night, didn't wrap his changes around a > begin/commit/rollback statement, and dropped a column he needs > back. The WAL logs are now the only place the column and the data > for that column exist. If I took a file-based backup of the > current database (read: today), could I apply the WAL logs (from > up to when they made that change) to that file-based backup to get > the data back that he needs? How much of the data was in that column when the pg_dump was run? You could certainly recover any of that. Data entered after that would be in the WAL file stream somewhere, but picking it out would be a very tedious and time-consuming process. I'm not aware of any tools which would make that easy, but capturing a file-based copy of your database as soon as possible, as well as keeping that old pg_dump output, would be important if you have any hope of sifting that out. I'd start by doing those, "just in case" -- but your best bet would be to try to find some other source to re-enter the data, if at all possible. Then be sure to follow backup directions from the documentation more closely, and *never* believe that any backup technique is working until you've tested a restore. On any product. I don't like to trust that any particular *backup* is good until I've restored it, even if the process hasn't changed. -Kevin