Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 63E5E650176 for ; Sat, 23 Aug 2008 02:29:19 -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 57685-03 for ; Sat, 23 Aug 2008 02:29:02 -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 8F2A8650164 for ; Sat, 23 Aug 2008 02:29:00 -0300 (ADT) Received: from asav-2.01.com (localhost.localdomain [127.0.0.1]) by asav-2.01.com (8.13.1/8.13.1) with SMTP id m7N5Strf006926; Sat, 23 Aug 2008 00:28:55 -0500 Received: from smtp-1.01.com (smtp-1.01.com [38.98.186.157]) by asav-2.01.com (asav-2.01.com [10.25.1.12]) id k7M0Sy2278802170ZD ret-id none; Sat, 23 Aug 2008 00:28:55 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-1.01.com (Postfix) with ESMTP id 5BFF8E0D7F; Sat, 23 Aug 2008 00:28:55 -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 BtpRPFyFdH7H; Sat, 23 Aug 2008 00:28:55 -0500 (CDT) Received: from [192.168.1.104] (unknown [76.194.27.53]) by smtp-1.01.com (Postfix) with ESMTP id E7021E0D7C; Sat, 23 Aug 2008 00:28:54 -0500 (CDT) Message-ID: <48AFA015.2000909@frostconsultingllc.com> Date: Fri, 22 Aug 2008 22:28:53 -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: <48AF9E8B.9020508@frostconsultingllc.com> In-Reply-To: <48AF9E8B.9020508@frostconsultingllc.com> Content-Type: multipart/alternative; boundary="------------070506090607000702020207" 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/138 X-Sequence-Number: 29983 This is a multi-part message in MIME format. --------------070506090607000702020207 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Jeff Frost wrote: > 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. I should also note that you could rename the database instead of dropping it outright, to make sure your restore is effective before dropping it. -- Jeff Frost, Owner Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 916-647-6411 FAX: 916-405-4032 --------------070506090607000702020207 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

Jeff Frost wrote:
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.
I should also note that you could rename the database instead of dropping it outright, to make sure your restore is effective before dropping it.

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