Drop All Foreign Keys ? PostgreSQL 7.2.1 - Mailing list pgsql-general

From Bart
Subject Drop All Foreign Keys ? PostgreSQL 7.2.1
Date
Msg-id bipur9$2agb$1@foka1.acn.pl
Whole thread Raw
List pgsql-general
Hello


Sometimes i need to drop one of my tables. DROP TABLE removes all
foreign keys connected with that table. After this i need to recreate FK.


It is not easy to find dropped keys, so i have script to create all keys
in database (ALTER TABLE ... ). It works good, but when  FK exists, it
will create another (exacly the same).

So when i run recreateFK script 4 times, i can find 4 exacly the same FK.

I think that script should first drop all FK and after this create all FK.

And there is my question. How to drop all FK from all tables in database ?


Greetings

Bart


pgsql-general by date:

Previous
From: "Sephiroth"
Date:
Subject: After install 7.3.4, I got a 7.3.3 ver. no?
Next
From: pginfo
Date:
Subject: Database corupption on pg 7.3.3