Re: Dumping/Restoring with constraints?

From: "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>
To: "Terry Lee Tucker" <terry(at)chosen-ones(dot)org>
Cc: "PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Dumping/Restoring with constraints?
Date: 2008-08-27 13:36:35
Message-ID: e373d31e0808270636q5120e562vd04c959e3fb9b5aa@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Wed, Aug 27, 2008 at 9:29 PM, Terry Lee Tucker <terry(at)chosen-ones(dot)org> wrote:

> We have all sorts of constraints and foreign keys and we have never had any
> problem with pg_restore related to dumping such that foreign keys are
> satisfied. You must have data already in the database that violates the
> restraints. You can restore in two phases; that is, by restoring the schema,
> and then the data using --disable-triggers. I'm assuming you are doing a
> binary dump. See the man page for pg_restore.

Thanks for this. I don't have any foreign key violations in my
existing database. I think the violation is happening because upon
restoring the table that is being populated checks in another table
that doesn't yet have data.

I am not using pg_restore. I am just using "psql --file=FILENAME"
syntax. Is that an issue?

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Nolan 2008-08-27 13:52:03 Re: [GENERAL] PITR - base backup question
Previous Message Merlin Moncure 2008-08-27 13:32:56 Re: [GENERAL] PITR - base backup question

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2008-08-27 13:47:24 Re: loop vs. aggregate was: update and group by/aggregate
Previous Message Merlin Moncure 2008-08-27 13:32:56 Re: [GENERAL] PITR - base backup question