From: Net Tree Inc. <nettreeinc@gmail.com>
To: pgsql-admin@postgresql.org
To: pgsql-general@postgresql.org
Subject: Re: how do I do dump and restore without bugging with constraint?
Date: Wed, 24 Feb 2010 09:57:14 +0800
Message-ID: <bd9689741002231757i688f8ba1n775a3f9c719b2d4d@mail.gmail.com> (raw)
In-Reply-To: <bd9689741002222050r1b782543rad955f64e46630ce@mail.gmail.com>
References: <bd9689741002222050r1b782543rad955f64e46630ce@mail.gmail.com>
I see something related with Deferrable and Initially deferrable that seems
like something could avoid constraints when dumping and restore, but it has
to modify the table or re-create all of them to have such option (maybe is
what you referraled "table definitions"). Is it what it can be use for to
avoid during dumping and restoring?
DEFERRABLE
NOT DEFERRABLE
This controls whether the constraint can be deferred. A constraint that is
not deferrable will be checked immediately after every command. Checking of
constraints that are deferrable can be postponed until the end of the
transaction (using the *SET
CONSTRAINTS*<http://www.postgresql.org/docs/8.3/static/sql-set-constraints.html>command).
NOT
DEFERRABLE is the default. Only foreign key constraints currently accept
this clause. All other constraint types are not deferrable.
INITIALLY IMMEDIATE
INITIALLY DEFERRED
If a constraint is deferrable, this clause specifies the default time to
check the constraint. If the constraint is INITIALLY IMMEDIATE, it is
checked after each statement. This is the default. If the constraint
is INITIALLY
DEFERRED, it is checked only at the end of the transaction. The constraint
check time can be altered with the *SET
CONSTRAINTS*<http://www.postgresql.org/docs/8.3/static/sql-set-constraints.html>command.
On Tue, Feb 23, 2010 at 12:50 PM, Net Tree Inc. <nettreeinc@gmail.com>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?
>
>
>
>
>
--
---------------------------------------
Steven Huang
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, pgsql-general@postgresql.org
Subject: Re: how do I do dump and restore without bugging with constraint?
In-Reply-To: <bd9689741002231757i688f8ba1n775a3f9c719b2d4d@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