Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D775963249C for ; Tue, 23 Feb 2010 02:39:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 43128-06 for ; Tue, 23 Feb 2010 06:39:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f46.google.com (mail-ww0-f46.google.com [74.125.82.46]) by mail.postgresql.org (Postfix) with ESMTP id F30E4632626 for ; Tue, 23 Feb 2010 02:39:12 -0400 (AST) Received: by wwf26 with SMTP id 26so604184wwf.19 for ; Mon, 22 Feb 2010 22:39:11 -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=Ox8i5ibwa62Y52kkVVbgwku9ki/jgVTI8bPcpQPPa6k=; b=FvVNJJHbQNsWnFh0c36xPV6+qf5iA9RI+6QQFW9pJIv7sW8rbJRJkYPfNXg7AZ6PqF /FzzYAfWLMq20MZfBf99PBHDV7CAp4LSWsSxivBOth/+V1o+GE1GNkfNgrYc8Uo2pci7 bhG0whybZ96bvogUR7qi8DFQbcmh/NSHIpRDo= 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=RJBC0/yJCivmVTggKhLR0mriTiZfvnfCBai0AcDlRyVpMaGsuBendtmhJYY/Q8mCw2 agqPHu2F14owspGjnA06WXDKAv8DAVHzZky+jWYhgOJD2UEp0HaKh7D3F1lhMcq6Fcmp egKApJVq1/KvYfg4Dc/TM8IlFESWv5qVZCkWs= MIME-Version: 1.0 Received: by 10.216.85.194 with SMTP id u44mr1613687wee.65.1266907151654; Mon, 22 Feb 2010 22:39:11 -0800 (PST) In-Reply-To: <4B836324.7090604@hogranch.com> References: <4B836324.7090604@hogranch.com> Date: Tue, 23 Feb 2010 14:39:11 +0800 Message-ID: Subject: Re: how do I do dump and restore without bugging with constraint? From: "Net Tree Inc." To: John R Pierce Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d7e744bcddc904803ece65 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/964 X-Sequence-Number: 159740 --0016e6d7e744bcddc904803ece65 Content-Type: text/plain; charset=ISO-8859-1 Ok, I am just trying to find the proper way to back and restore database that contain restriction. The other way to ask. If I have two 99% schema similar databases. The old one might contain few columns that does not exist in the new one and contain constrains that the new DB does not have. In that case, what's standard to do this? Since they are 99% similar in schema, can I do "data dump" only ? will that work? If owner for database between Old and new DB are different, do I must add that owner in by create new role? appreciated, Steven On Tue, Feb 23, 2010 at 1:09 PM, John R Pierce wrote: > Net Tree Inc. wrote: > >> 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? >> >> >> >> > > if you're dumping the schema and the data, you should be restoring into an > empty database, not into an existing database. > > > -- --------------------------------------- Steven Huang --0016e6d7e744bcddc904803ece65 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ok, I am just trying to find the proper way to back and restore database th= at contain restriction.=A0

The other way to ask. If I ha= ve two 99% schema=A0similar databases. The old one might contain few column= s that does not exist in the new one and contain constrains that the new DB= does not have. In that case, what's standard to do this?=A0

Since they are 99% similar in schema, can I do "da= ta dump" only ? will that work?=A0

If owner f= or database between Old and new DB are different, do I must add that owner = in by create new role?

appreciated,

Steven
=

On Tue, Feb 23, 2010 at 1:09 PM, John R = Pierce <pierce@= hogranch.com> wrote:
Net Tree Inc. wrote:
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?





if you're dumping the schema and the data, you should be restoring into= an empty database, not into an existing database.





--
-----------------------= ----------------
Steven Huang
--0016e6d7e744bcddc904803ece65--