pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Net Tree Inc. <nettreeinc@gmail.com>
To: Iñigo Martinez Lasala <imartinez@vectorsf.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: how do I do dump and restore without bugging with constraint?
Date: Wed, 24 Feb 2010 00:36:10 +0800
Message-ID: <bd9689741002230836h2d3b074au35836c131474f25b@mail.gmail.com> (raw)
In-Reply-To: <1266922981.24312.217.camel@coyote>
References: <bd9689741002222050r1b782543rad955f64e46630ce@mail.gmail.com>
	<1266922981.24312.217.camel@coyote>

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ñigo 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-triggers
> -a data.dmp
>
>
>
> -----Original Message-----
> *From*: Net Tree Inc. <nettreeinc@gmail.com<%22Net%20Tree%20Inc.%22%20%3cnettreeinc@gmail.com%3e>
> >
> *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?
>
>
>
>
>
>
>
>
>
>


-- 
---------------------------------------
Steven Huang

view thread (17+ messages)  latest in thread

Message-ID: <bd9689741002230836h2d3b074au35836c131474f25b@mail.gmail.com>
Permalink:  ../bd9689741002230836h2d3b074au35836c131474f25b@mail.gmail.com/
Also on:    postgresql.org/message-id/bd9689741002230836h2d3b074au35836c131474f25b@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: nettreeinc@gmail.com, imartinez@vectorsf.com, pgsql-general@postgresql.org
  Subject: Re: how do I do dump and restore without bugging with constraint?
  In-Reply-To: <bd9689741002230836h2d3b074au35836c131474f25b@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox