Created
January 13, 2011 07:38
-
-
Save sriedel/777539 to your computer and use it in GitHub Desktop.
Remove FK constraints from postgres database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'ALTER TABLE ' || t.table_name || ' DROP CONSTRAINT ' || t.constraint_name || ';' | |
from information_schema.table_constraints t | |
where t.constraint_type = 'FOREIGN KEY'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment