From: Glyn Astill <glynastill@yahoo.co.uk>
To: pgsql-admin@postgresql.org, Lukasz Brodziak <lukasz.brodziak@gmail.com>
Subject: Re: Dropping all constraints in database
Date: Mon, 14 Mar 2011 10:51:38 +0000 (GMT)
Message-ID: <810750.89007.qm@web26006.mail.ukl.yahoo.com> (raw)
In-Reply-To: <AANLkTimD8w0v3OPySWRLFojzfNgyG1iv1+h4OB7rzm-J@mail.gmail.com>
> From: Lukasz Brodziak <lukasz.brodziak@gmail.com>
> Subject: [ADMIN] Dropping all constraints in database
> To: pgsql-admin@postgresql.org
> Date: Monday, 14 March, 2011, 9:26
> 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.
>
>
Magnus Hagander wrote about a method to do that here:
http://blog.hagander.net/archives/131-Automatically-dropping-and-creating-constraints.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: glynastill@yahoo.co.uk, lukasz.brodziak@gmail.com
Subject: Re: Dropping all constraints in database
In-Reply-To: <810750.89007.qm@web26006.mail.ukl.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox