Re: Facing error while restoring the database

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Facing error while restoring the database
Date: 2012-03-27 15:06:46
Message-ID: 1456867.7feJTIYbIQ@skynet.simkin.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, March 27, 2012 08:20:23 PM Akshay Joshi wrote:
> In my case I won't allow anyone to insert/modify the rows of sample_one
> table. I have already inserted some rows in sample_one table where I
> want one constraint is number of array elements of sample_one.param_names
> and sample.params must be same. That's why I have created
> CHECK constraint in sample table. User can insert, modify and delete the
> rows of sample table, so I don't want any mismatch in the number of
> array elements of sample_one.param_names and sample.params table.
>

Well you have a couple of options.

1) Redesign to use a trigger instead of a check constraint.

2) During restore, you can use a custom table of contents extracted from the
dump, remove the constraint from that, do your restore, and then create the
constraint manually afterwards. This requires that you use the custom dump
format and pg_restore, of course.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Welty, Richard 2012-03-27 15:25:53 configuring RAID10 for data in Amazon EC2 cloud?
Previous Message Akshay Joshi 2012-03-27 14:50:23 Re: Facing error while restoring the database