Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2FBBA633116 for ; Tue, 23 Feb 2010 07:03:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 25901-09 for ; Tue, 23 Feb 2010 11:03:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hermes.vectorsf.com (firewall.vectorsf.com [62.82.80.62]) by mail.postgresql.org (Postfix) with ESMTP id B6B0163F322 for ; Tue, 23 Feb 2010 07:03:09 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by hermes.vectorsf.com (Postfix) with ESMTP id 8FE1611C0673; Tue, 23 Feb 2010 12:03:05 +0100 (CET) X-Virus-Scanned: amavisd-new at hermes.vectorsf.com Received: from hermes.vectorsf.com ([127.0.0.1]) by localhost (hermes.vectorsf.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qsvga7CUk2AO; Tue, 23 Feb 2010 12:03:01 +0100 (CET) Received: from [10.70.4.200] (unknown [10.70.4.200]) (Authenticated sender: imartinez) by hermes.vectorsf.com (Postfix) with ESMTP id 6B16111C066D; Tue, 23 Feb 2010 12:03:01 +0100 (CET) Subject: Re: how do I do dump and restore without bugging with constraint? From: =?ISO-8859-1?Q?I=F1igo?= Martinez Lasala To: "Net Tree Inc." Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: multipart/alternative; boundary="=-AYuT53EMBCXysweEEH8V" Date: Tue, 23 Feb 2010 12:03:01 +0100 Message-ID: <1266922981.24312.217.camel@coyote> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/178 X-Sequence-Number: 33781 --=-AYuT53EMBCXysweEEH8V Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Using pg_dump from your new host (that is, newer version) 1- Dump schema. pg_dump -h server_source -U username -s -Fp -f schema.sql database 2- Dump data only. pg_dump -h server_source -U username -a -Fc -f data.dmp database 3- Modify schema. 4- Restore schema in new host. psql -U username -d database -h server_destination -f modified_schema.sql 5- Restore data disabling triggers pg_restore -h server_destination -U username -d database --disable-triggers -a data.dmp -----Original Message----- From: Net Tree Inc. To: pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: [ADMIN] how do I do dump and restore without bugging with constraint? Date: Tue, 23 Feb 2010 12:50:27 +0800 Hi all, I am dumping both schema and data from old database to new one. The new database schema is somehow contain slightly different schema then the old one. When I do restore it shown alot errors related with constraints. How can I dump and to restore from old to new without dealing with constraint and just forces data dump to where it suppose to belong? --=-AYuT53EMBCXysweEEH8V Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit Using pg_dump from your new host (that is, newer version)

1- Dump schema.
pg_dump -h server_source -U username -s -Fp -f schema.sql database

2- Dump data only.
pg_dump -h server_source -U username -a -Fc -f data.dmp database

3- Modify schema.

4- Restore schema in new host.
psql -U username -d database -h server_destination -f modified_schema.sql

5- Restore data disabling triggers
pg_restore -h server_destination -U username -d database --disable-triggers -a data.dmp


-----Original Message-----
From: Net Tree Inc. <nettreeinc@gmail.com>
To: pgsql-admin@postgresql.org, pgsql-general@postgresql.org
Subject: [ADMIN] how do I do dump and restore without bugging with constraint?
Date: Tue, 23 Feb 2010 12:50:27 +0800

Hi all,

I am dumping both schema and data from old database to new one. The new database schema is somehow contain slightly different schema then the old one. When I do restore it shown alot errors related with constraints. How can I dump and to restore from old to new without dealing with constraint and just forces data dump to where it suppose to belong? 









--=-AYuT53EMBCXysweEEH8V--