Drop all constraints

From: Gianvito Pio <pio(dot)gianvito(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Drop all constraints
Date: 2010-03-06 16:34:08
Message-ID: 4B928400.1070709@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all,
is there a way to drop all constraints of a table?

I found this workaround in the manual:

CREATE TABLE temp AS SELECT * FROM distributors;
DROP TABLE distributors;
CREATE TABLE distributors AS SELECT * FROM temp;
DROP TABLE temp;

Is there any other way to do it?
Thanks

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2010-03-06 17:17:05 Re: Drop all constraints
Previous Message Petru Ghita 2010-03-06 16:16:45 Re: Does IMMUTABLE property propagate?