Re: Facing error while restoring the database

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

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:
> > Hi
> >
> > I am facing issue while restoring the database. I have taken the backup
> of
> > my database using pg_dump and then create new database and try to
> restore it
> > using pg_restore. I am using PostgreSQL 9.0.
>
> What is the error?
>

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.

>
> It looks like you are trying to use pg_restore on a plain text dump.
> In that case, use psql to restore instead.

No, I have used Tar format. I have taken the backup using following
command
pg_dump.exe --host localhost --port 5433 --username "postgres"
--no-password --verbose --file "C:\Users\Akshay\Desktop\sample_tar.backup"
"Test_Backup"

And restore it on new database "Test_Restore" using following command
pg_restore.exe --host localhost --port 5433 --username "postgres" --dbname
"Test_Restore" --no-password --verbose
"C:\Users\Akshay\Desktop\sample_tar.backup"

> --
> If you can't see the forest for the trees,
> Cut the trees and you'll see there is no forest.
>

--
*Akshay Joshi
Senior Software Engineer
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246*

In response to

Responses

Browse pgsql-general by date

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