Re: Facing error while restoring the database - Mailing list pgsql-general

From Akshay Joshi
Subject Re: Facing error while restoring the database
Date
Msg-id CANxoLDd88ktgv6BAUppStWrofYtKC_9meUJzntGtRA_=M+LiHA@mail.gmail.com
Whole thread Raw
In response to Re: Facing error while restoring the database  (Alban Hertroys <haramrae@gmail.com>)
Responses Re: Facing error while restoring the database  (Alban Hertroys <haramrae@gmail.com>)
List pgsql-general


On Tue, Mar 27, 2012 at 6:15 PM, Alban Hertroys <haramrae@gmail.com> wrote:
On 27 March 2012 11:33, Akshay Joshi <akshay.joshi@enterprisedb.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

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Facing error while restoring the database
Next
From: Kenneth Tilton
Date:
Subject: How can I modify a row in a function such that the caller sees it?