Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 720DE64FCD4 for ; Wed, 27 Aug 2008 11:23:49 -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 16614-04 for ; Wed, 27 Aug 2008 11:23:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by postgresql.org (Postfix) with ESMTP id DC98D64FCBA for ; Wed, 27 Aug 2008 11:23:42 -0300 (ADT) Received: from vanquish.ws.pitbpa0.priv.collaborativefusion.com (vanquish.ws.pitbpa0.priv.collaborativefusion.com [192.168.2.162]) (SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Wed, 27 Aug 2008 10:23:41 -0400 id 00056415.0000000048B5636D.000120D1 Date: Wed, 27 Aug 2008 10:24:03 -0400 From: Bill Moran To: "Phoenix Kiula" Cc: "PG-General Mailing List" Subject: Re: Dumping/Restoring with constraints? Message-Id: <20080827102403.dc69c802.wmoran@collaborativefusion.com> In-Reply-To: References: <22708.1219845242@sss.pgh.pa.us> Organization: Collaborative Fusion X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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/948 X-Sequence-Number: 136778 In response to "Phoenix Kiula" : > > The recommended solution is to use a regular schema-and-data dump. > > If you really have to separate schema and data, the --disable-triggers > > switch might help, though you open yourself to the possibility of > > loading inconsistent data that way. > > Thanks Tom. > > 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. > > The local database is already created, with all tables and constraints and all. Don't do that. Do one of the following: *) Allow the dump file to create all tables. *) In the early step dump the data only with pg_dumpall --disable-triggers -a -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ wmoran@collaborativefusion.com Phone: 412-422-3463x4023