Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2C553632E83 for ; Thu, 18 Feb 2010 18:20:36 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51223-04 for ; Thu, 18 Feb 2010 22:20:25 +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 5590A632755 for ; Thu, 18 Feb 2010 18:20:25 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 18 Feb 2010 16:20:23 -0600 Message-Id: <4B7D68BF020000250002F3D4@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 18 Feb 2010 16:20:15 -0600 From: "Kevin Grittner" To: "Brad Littlejohn" , "'pgsql-admin@postgresql.org'" Subject: Re: Apply WAL logs after database restore References: 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=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/140 X-Sequence-Number: 33743 Brad Littlejohn wrote: > I performed a backup of the database, using pg_dump > I have WAL-based log shipping enabled on that server. > > I just created a second database server that will be a recovery > server, compiled and installed PostgreSQL onto it, and restored > the full backup taken from the primary database onto it. Since > this wasn't a base backup (using tar, cpio, etc.), how would I > apply the WAL logs to this secondary server, to get it up to > current? That can't be done -- pg_dump uses COPY or INSERT statements (depending on your pg_dump options) which are *row* based, while WAL files are *page* based. They are alternative techniques which can't be mixed and matched. > All of the documentation I've read so far uses a base backup. Is > there any way to apply the logs generated since that backup > created by pg_dump to get the secondary database up to current? No, you can only apply WAL files to a file-based image of the source database, not to a database created through other means which happens to contain the same data. -Kevin