Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id AA054650176 for ; Sat, 23 Aug 2008 02:22:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48791-07 for ; Sat, 23 Aug 2008 02:22:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.01.com (lb-2.01.com [38.98.186.147]) by postgresql.org (Postfix) with ESMTP id 6B853650177 for ; Sat, 23 Aug 2008 02:22:31 -0300 (ADT) Received: from asav-1.01.com (localhost.localdomain [127.0.0.1]) by asav-1.01.com (8.13.1/8.13.1) with SMTP id m7N5MLcP027237; Sat, 23 Aug 2008 00:22:22 -0500 Received: from smtp-1.01.com (smtp-1.01.com [38.98.186.157]) by asav-1.01.com (asav-1.01.com [10.25.1.11]) id k7M0ML0518634980Q2 ret-id none; Sat, 23 Aug 2008 00:22:22 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-1.01.com (Postfix) with ESMTP id BD890E0CA2; Sat, 23 Aug 2008 00:22:21 -0500 (CDT) Received: from smtp-1.01.com ([127.0.0.1]) by localhost (smtp-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cwPeKNxARh7s; Sat, 23 Aug 2008 00:22:21 -0500 (CDT) Received: from [192.168.1.104] (unknown [76.194.27.53]) by smtp-1.01.com (Postfix) with ESMTP id 48964E0C8D; Sat, 23 Aug 2008 00:22:21 -0500 (CDT) Message-ID: <48AF9E8B.9020508@frostconsultingllc.com> Date: Fri, 22 Aug 2008 22:22:19 -0700 From: Jeff Frost Organization: Frost Consulting, LLC User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Tena Sakai CC: pgsql-admin@postgresql.org Subject: Re: restoring from dump References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------010405070900060001030008" X-FSL-MailScanner-Information: Please contact postmaster@01.com for more information X-FSL-MailScanner: Found to be clean X-FSL-MailScanner-SpamCheck: X-FSL-MailScanner-From: jeff@frostconsultingllc.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200808/137 X-Sequence-Number: 29982 This is a multi-part message in MIME format. --------------010405070900060001030008 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Tena Sakai wrote: > > > If you want to restore all the databases that were in this > > postgresql installation at the time of the backup, then the > > best thing to do is drop all those DBs before attempting the > > restore. > Yes, the database in question is built and updated continuously > from a several sources. There was a massive power failure, > a series of them, and things got to be a very inconsistent > state and therefore we need to go back to a reliable, trustworthy > backup and then rebuild from there. > > What I gather, from your comments, all I have to do would to issue > a psql command: > drop database > then repeat what I did from shell prompt, ie., > zcat | psql postgres > restore.out 2 > restore.err > > Would you mind confirming if I am understanding you correctly? > Yes, based on the information you've given us, you should be able to restore the entire database (and any other databases that were in the cluster) by first dropping those databases and then issuing the above command. BTW, if you find yourself with an older version of postgresql, this could be a good opportunity to upgrade. I'm not sure if you mentioned what version you were using in your original post. -- Jeff Frost, Owner Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 916-647-6411 FAX: 916-405-4032 --------------010405070900060001030008 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Tena Sakai wrote:
RE: [ADMIN] restoring from dump

> If you want to restore all the databases that were in this
> postgresql installation at the time of the backup, then the
> best thing to do is drop all those DBs before attempting the
> restore.
Yes, the database in question is built and updated continuously
from a several sources.  There was a massive power failure,
a series of them, and things got to be a very inconsistent
state and therefore we need to go back to a reliable, trustworthy
backup and then rebuild from there.

What I gather, from your comments, all I have to do would to issue
a psql command:
  drop database <dbname>
then repeat what I did from shell prompt, ie.,
  zcat <compressed_file> | psql postgres > restore.out 2 > restore.err

Would you mind confirming if I am understanding you correctly?

Yes, based on the information you've given us, you should be able to restore the entire database (and any other databases that were in the cluster) by first dropping those databases and then issuing the above command.

BTW, if you find yourself with an older version of postgresql, this could be a good opportunity to upgrade.  I'm not sure if you mentioned what version you were using in your original post.



-- 
Jeff Frost, Owner 	<jeff@frostconsultingllc.com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 916-647-6411	FAX: 916-405-4032
--------------010405070900060001030008--