Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 777F2633738; Tue, 23 Feb 2010 12:36:22 -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 79969-09; Tue, 23 Feb 2010 16:36:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 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.25]) by mail.postgresql.org (Postfix) with ESMTP id 84206633103; Tue, 23 Feb 2010 12:36:11 -0400 (AST) Received: by ey-out-2122.google.com with SMTP id 25so761182eya.33 for ; Tue, 23 Feb 2010 08:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=D5OFJIQ9ps/Oo4oNYszyvUmX3gbTdfcVA0wrtTjJZms=; b=gm60Qo1RKuwE+gtmILteb4fWQvuaD7LWBjEJQx4yrP6Ksm6syAAEONfF1rYQZScw8J CujGClIH1TKA3L5cnNgKFn+gpwvTZBo5kFymbGHkG4Cu05vmZrGiMGDAZ46PasL7b0Xu iGRCXQivyUfOQyZW1By3ZXZl9ScFM5ShDu58U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=YCuLNHZiabUZcbvUMrWzC2W0YdxgvCI08OApWdvOk8UycXGow6QiGkBPx7bGPbM0oY nWWEcSkTLUuvmzfNFLcpA3/n6799l2mnb8hJpx6LCcHkIoVVcWPfn9FmyL7m6fTDaYzh YzWjDoCrjKVB1N6XROlVFhP3zZ0t2m53gD7kI= MIME-Version: 1.0 Received: by 10.216.88.12 with SMTP id z12mr255906wee.165.1266942970411; Tue, 23 Feb 2010 08:36:10 -0800 (PST) In-Reply-To: <1266922981.24312.217.camel@coyote> References: <1266922981.24312.217.camel@coyote> Date: Wed, 24 Feb 2010 00:36:10 +0800 Message-ID: Subject: Re: how do I do dump and restore without bugging with constraint? From: "Net Tree Inc." To: =?ISO-8859-1?Q?I=F1igo_Martinez_Lasala?= Cc: pgsql-admin@postgresql.org, pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary=0016e6da7ae5b3bd270480472588 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/181 X-Sequence-Number: 33784 --0016e6da7ae5b3bd270480472588 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks. Is it by doing these steps I can avoid constrain restriction? for step 3, how should I modify the schema? and which schema? the target DB's schema that I am trying to dump the schema and data in? But this is the problem, I am not sure whats different between the two schema's, there are just too many tables to check. What's your tips? Steven On Tue, Feb 23, 2010 at 7:03 PM, I=F1igo Martinez Lasala < imartinez@vectorsf.com> wrote: > 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-trigge= rs > -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? > > > > > > > > > > --=20 --------------------------------------- Steven Huang --0016e6da7ae5b3bd270480472588 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks. Is it by doing these steps I can avoid constrain restriction? for s= tep 3, how should I modify the schema? and which schema? the target DB'= s schema that I am trying to dump the schema and data in? But this is the p= roblem, I am not sure whats different between the two schema's, there a= re just too many tables to check. What's your tips?

Steven

On Tue, Feb 23, 2010 at 7:03 P= M, I=F1igo Martinez Lasala <imartinez@vectorsf.com> wrote:
=20 =20
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><= br> To: = pgsql-admin@postgresql.org, pgsql-general@postgresql.org
Subject: [ADMIN] how do I do dump and restore without bugging with c= onstraint?
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 dat= abase 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 ju= st forces data dump to where it suppose to belong?=A0












--
-----------------------= ----------------
Steven Huang
--0016e6da7ae5b3bd270480472588--