Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A017B8D5779 for ; Tue, 8 Nov 2011 15:26:02 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 28662-03-6 for ; Tue, 8 Nov 2011 19:25:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from shrek.krogh.cc (2605ds1-ynoe.0.fullrate.dk [90.184.12.24]) by mail.postgresql.org (Postfix) with ESMTP id 70EB01F74909 for ; Tue, 8 Nov 2011 15:25:01 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by shrek.krogh.cc (Postfix) with ESMTP id A2FAFC448CD for ; Tue, 8 Nov 2011 20:24:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at shrek.krogh.cc Received: from shrek.krogh.cc ([127.0.0.1]) by localhost (shrek.krogh.cc [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J6AhnQK1e6iL for ; Tue, 8 Nov 2011 20:24:40 +0100 (CET) Received: from [90.184.13.151] (2605ds1-ynoe.2.fullrate.dk [90.184.13.151]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jesper@krogh.cc) by shrek.krogh.cc (Postfix) with ESMTPSA id DA041C44277 for ; Tue, 8 Nov 2011 20:24:39 +0100 (CET) Message-ID: <4EB981F7.5040802@krogh.cc> Date: Tue, 08 Nov 2011 20:24:39 +0100 From: Jesper Krogh User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Untraditional point in time recovery. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/21 X-Sequence-Number: 38615 Hi List. I have somehow, come up with a postgresql left in this state.. The database crashed today, needing to do a point in time restore that should stop today before 10:30. I do have wal-files from today - 7 days available and I have a scheduled base backup that runs: pg_start_backup before and pg_stop backup after, once a week. The last one being -2 days old and the former being -9 days old. When inspecting the backup I can see that the former backup had failed to run "pg_stop_backup" so, the pg_start_backup command of the -2 base backup has failed. Can I instruct to postgresql to start from the -2 days base backup and go back to the last "checkpoint" prior to the backup start form the transaction logs and apply log from that point up until today? Normally I would just start by the -9 base and apply wal-log from there, but I am missing a days worth log-file to do that. So the situation is: pg_start_backup was run 9 days ago pg-dirs was copied 2 days ago pg_stop_backup was run 2 days ago. I have now-7days worth of archived logs. It should be safe to just apply "wal-log" from any state prior to -2 days ago? Can somehow instruct pg to do just that? And reach consistent state after that. Should I manually craft a backup_label file? thanks. Jesper .. and yes, I'll make sure that the exitstatus from pg_start_backup gets propagated correctly back from now on..