Re: BUG #3850: Incompatibility among pg_dump / pg_restore.

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Diego Spano <djspano(at)jus(dot)gov(dot)ar>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3850: Incompatibility among pg_dump / pg_restore.
Date: 2008-01-04 19:25:20
Message-ID: 477E8820.4040607@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Diego Spano wrote:
> The following bug has been logged online:
>
> Bug reference: 3850
> Logged by: Diego Spano
> Email address: djspano(at)jus(dot)gov(dot)ar
> PostgreSQL version: 8.1.9
> Operating system: Debian Etch 4.0
> Description: Incompatibility among pg_dump / pg_restore.
> Details:
>
> I have two servers running Debian Etch 4.0 and Postgres 8.1.9. and want to
> copy Database_A from server1 to server2. It is suppossed that
> pg_dump/pg_restore should have no problems.
>
> In server1 run pg_dump, then run pg_restore on server2, but the database
> can´t be restored because pg_restore want to restore table rows that have
> foreign keys before table that have the primary keys.
>
> "pg_restore: ERROR: the new record for relation «archivo» violates
> restriction. Check "subfk_archivo_seremp".
>
> And records are not added obviously.
>
> I think that pg_dump should export database tablas according to constraints
> and relations, don´t?

pg_dump by default will dump table structure first than data and apply
constraints only at the very end so this is usually a "can't happen"
error. If you are nevertheless getting errors like this you are likely
using a data-only dump or seperate schema/data dumps which obviously
cannot provide those guarantees.

regards

Stefan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Lunter 2008-01-05 01:05:28 BUG #3851: suggestion - support for stored procedures
Previous Message Diego Spano 2008-01-04 18:48:11 BUG #3850: Incompatibility among pg_dump / pg_restore.