Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EF2D76502AE for ; Wed, 27 Aug 2008 11:43:34 -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 37985-04-2 for ; Wed, 27 Aug 2008 11:43:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1625C64FCF6 for ; Wed, 27 Aug 2008 11:42:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m7REgv67023572; Wed, 27 Aug 2008 10:42:57 -0400 (EDT) To: "Phoenix Kiula" cc: "PG-General Mailing List" Subject: Re: Dumping/Restoring with constraints? In-reply-to: References: <22708.1219845242@sss.pgh.pa.us> Comments: In-reply-to "Phoenix Kiula" message dated "Wed, 27 Aug 2008 22:12:57 +0800" Date: Wed, 27 Aug 2008 10:42:56 -0400 Message-ID: <23571.1219848176@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/952 X-Sequence-Number: 136782 "Phoenix Kiula" writes: > This is the dump command being used on a 8.2.3 database on Linux: > $ pg_dumpall > mydb.sql > $ umask 077 > $ gzip mydb.sql > Then I download the mydb.sql.gz file into my local computer (Mac OSX > with 8.3.3) and unzip it to mydb.sql. That's all fine ... > The local database is already created, with all tables and constraints and all. ... but this isn't. A pg_dump script expects to restore into an empty database. For pg_dumpall, you shouldn't even have created the databases, just start from a virgin installation. regards, tom lane