Re: Facing error while restoring the database

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Facing error while restoring the database
Date: 2012-03-27 13:47:12
Message-ID: CAF-3MvPvD+DyW4x_SG5qzkHCYgqkSJz7VKEGuDA4Uw97ZCynWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 27 March 2012 15:12, Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com> wrote:
> On Tue, Mar 27, 2012 at 6:15 PM, Alban Hertroys <haramrae(at)gmail(dot)com> wrote:
>>
>> On 27 March 2012 11:33, Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
>> wrote:
>    pg_restore: restoring data for table "sample"
>    pg_restore: [archiver (db)] Error while PROCESSING TOC:
>    pg_restore: [archiver (db)] Error from TOC entry 1800; 0 54031 TABLE DATA
> sample postgres
>    pg_restore: [archiver (db)] COPY failed for table "sample": ERROR:  new
> row for relation "sample" violates check constraint
> "check_params_array_size"
>    CONTEXT:  COPY sample, line 1: "1 2 {}"
>    pg_restore: restoring data for table "sample_one"
>
>   As per the above log, it is clear that restoring of sample table start
> before sample_one and due to that my "check_params_array_size" constraint
> gets failed.

Aha, it's a check constraint! Those don't cover multiple tables, so
the order in which tables with check constraints get restored should
not matter.

In your case it apparently does matter, which seems to indicate that
you did something to circumvent that limitation and are now running
into problems because of that.

What's the definition of that constraint?

Perhaps a foreign key constraint would server you? Adding one should
at least make sure your database gets dumped in the correct order.
--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2012-03-27 13:48:08 Re: Facing error while restoring the database
Previous Message Kenneth Tilton 2012-03-27 13:26:22 How can I modify a row in a function such that the caller sees it?