Dropping all constraints in database

From: Lukasz Brodziak <lukasz(dot)brodziak(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Dropping all constraints in database
Date: 2011-03-14 09:26:52
Message-ID: AANLkTimD8w0v3OPySWRLFojzfNgyG1iv1+h4OB7rzm-J@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

Is there a way of disabling/dropping all constrainsts in a given
database? I need to restore a db which has duplicate values in nearly
half of its tables then remove duplicates and then add the constraints
back. Is there a way to do that for each table in one
statement/function? It may be even a java/perl script if it can do
such a thing. Thank You all in advance for help.

--
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Thomas Kellerer 2011-03-14 09:43:09 Re: Dropping all constraints in database
Previous Message Gnanakumar 2011-03-14 08:09:55 Temporary table failed to drop after power failure