X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 043F7D1B181 for ; Tue, 13 Jul 2004 20:21:32 -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 19484-10 for ; Tue, 13 Jul 2004 23:21:32 +0000 (GMT) Received: from cmailm4.svr.pol.co.uk (cmailm4.svr.pol.co.uk [195.92.193.211]) by svr1.postgresql.org (Postfix) with ESMTP id 54795D1B1AA for ; Tue, 13 Jul 2004 20:21:28 -0300 (ADT) Received: from modem-89.lynx.dialup.pol.co.uk ([217.135.192.89] helo=[192.168.0.100]) by cmailm4.svr.pol.co.uk with esmtp (Exim 4.14) id 1BkWaX-0000dh-FF; Wed, 14 Jul 2004 00:21:29 +0100 Subject: Re: Point in Time Recovery From: Simon Riggs To: Bruce Momjian Cc: Tom Lane , pgsql-hackers@postgresql.org In-Reply-To: <200407132301.i6DN1fb16205@candle.pha.pa.us> References: <200407132301.i6DN1fb16205@candle.pha.pa.us> Content-Type: text/plain Organization: 2nd Quadrant Message-Id: <1089760888.17493.3347.camel@stromboli> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Wed, 14 Jul 2004 00:21:28 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/735 X-Sequence-Number: 56296 On Wed, 2004-07-14 at 00:01, Bruce Momjian wrote: > Tom Lane wrote: > > Simon Riggs writes: > > > So the situation is: > > > - You must only stop recovery at a point in time (in the logs) after the > > > backup had completed. > > > > Right. > > > > > No way to enforce that currently, apart from procedurally. Not exactly > > > frequent, so I think I just document that and move on, eh? > > > > The procedure that generates a backup has got to be responsible for > > recording both the start and stop times. If it does not do so then > > it's fatally flawed. (Note also that you had better be careful to get > > the time as seen on the server machine's clock ... this could be a nasty > > gotcha if the backup is run on a different machine, such as an NFS > > server.) > > OK, but procedurally, how do you correlate the start/stop time of the > tar backup with the WAL numeric file names? No need. You just correlate the recovery target with the backup file times. Mostly, you'll only ever use your last backup and won't need to fuss with the times. Backup should begin with a CHECKPOINT...then wait for that to complete, just to make the backup as current as possible. If you want to start purging your archives of old archived xlogs, you can use the filedate (assuming you preserved that on your copy to archive - but even if not, they'll be fairly close). Best regards, Simon Riggs