By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,438 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,438 IT Pros & Developers. It's quick & easy.

Drop All Foreign Keys ? PostgreSQL 7.2.1

P: n/a
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 ?


Nov 11 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.