X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7E51B528BB for ; Thu, 23 Jun 2005 15:59:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10527-08 for ; Thu, 23 Jun 2005 18:59:20 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 32F22528B7 for ; Thu, 23 Jun 2005 15:59:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j5NIxKPp007528; Thu, 23 Jun 2005 14:59:20 -0400 (EDT) To: Jeff Frost Cc: pgsql-admin@postgresql.org Subject: Re: restoring wal archive and pg_xlog dir In-reply-to: References: <7197.1119551082@sss.pgh.pa.us> Comments: In-reply-to Jeff Frost message dated "Thu, 23 Jun 2005 11:41:17 -0700" Date: Thu, 23 Jun 2005 14:59:20 -0400 Message-ID: <7527.1119553160@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/176 X-Sequence-Number: 17931 Jeff Frost writes: > So, that, immediately begs the question as to why the docs indicate we > should clear out all the files in the pg_xlog directory before > beginning the restore? Wouldn't it be better to keep them in place? IIRC, the docs recommend getting rid of any xlog files that were copied as part of your base backup: they are either too old to be interesting (if finished before the base backup started) or not to be trusted because they might be incomplete (if they were actively being written while the base backup proceeded). You have to get this range of data from your archive in order to trust it. The reason we avoid overwriting data automatically is that we don't know what is in your local pg_xlog exactly; there might be xlog files that are newer than the base backup and potentially contain data not available anywhere else (if for some reason they never got copied to the archive area). So prudence dictates not wiping them out. > Ohhhh...I guess I misunderstood the meaning of base backup. So, what I really > need if my .backup file is named: 000000010000000500000051.00FB6C60.backup, > then I need at least the following to do a restore: > pg_xlog/000000010000000500000051 > PGDATA base backup > and then any archived wal files that come after 51? You got it. regards, tom lane