Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 13B6964FCBA for ; Wed, 27 Aug 2008 10:36:48 -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 67848-02 for ; Wed, 27 Aug 2008 10:36:33 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by postgresql.org (Postfix) with ESMTP id F1C3364FCD5 for ; Wed, 27 Aug 2008 10:36:37 -0300 (ADT) Received: by ey-out-2122.google.com with SMTP id 6so449116eyi.61 for ; Wed, 27 Aug 2008 06:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=/WLJ5mQpUFK76umYjv+BldYUzGaHIgL+n0FU98l04fA=; b=LxAK/k6XjXsc8DLDJs3DdpFbfJz1jjT17UqdJKJxB1WRhgReQt3Ji1XCCw5xCGE18B vUceLREqYMWUkL0D4yU9nOBR/GjVJYF1g3YXWoya15gwOwticbK7zsVxvPR1hpF3Ek40 465J6P44s3w7Z53PbnGlaxO0BAojHYRjikBPY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=K+HzRX650rgSpaNcKPsSg1iWgumiAvnBNuRo/XqrOFuoYDBa9K+5s+Is4hgozHqC3+ PB1+/sHdPdyrQC+x0suRrqPf89erycSGBdB2UoGD/uZd+s+cQZCKTyqkyiraMMhf7gFN CVKKxMJR7Jd6EG5o8C5zerDaXyf9rkmHhQ/O0= Received: by 10.210.90.10 with SMTP id n10mr10215568ebb.128.1219844195891; Wed, 27 Aug 2008 06:36:35 -0700 (PDT) Received: by 10.210.130.1 with HTTP; Wed, 27 Aug 2008 06:36:35 -0700 (PDT) Message-ID: Date: Wed, 27 Aug 2008 21:36:35 +0800 From: "Phoenix Kiula" To: "Terry Lee Tucker" Subject: Re: Dumping/Restoring with constraints? Cc: "PG-General Mailing List" In-Reply-To: <200808270929.42049.terry@chosen-ones.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200808270929.42049.terry@chosen-ones.org> 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/940 X-Sequence-Number: 136770 On Wed, Aug 27, 2008 at 9:29 PM, Terry Lee Tucker wrote: > We have all sorts of constraints and foreign keys and we have never had any > problem with pg_restore related to dumping such that foreign keys are > satisfied. You must have data already in the database that violates the > restraints. You can restore in two phases; that is, by restoring the schema, > and then the data using --disable-triggers. I'm assuming you are doing a > binary dump. See the man page for pg_restore. Thanks for this. I don't have any foreign key violations in my existing database. I think the violation is happening because upon restoring the table that is being populated checks in another table that doesn't yet have data. I am not using pg_restore. I am just using "psql --file=FILENAME" syntax. Is that an issue?