Created
April 7, 2017 16:15
-
-
Save Sillson/0294031c2231c72bbc8e7d046e038ccf to your computer and use it in GitHub Desktop.
Drop foreign schema tables
This file contains hidden or 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
do | |
$$ | |
declare | |
l_rec record; | |
begin | |
for l_rec in (select foreign_table_schema, foreign_table_name | |
from information_schema.foreign_tables) loop | |
execute format('drop foreign table %I.%I cascade', l_rec.foreign_table_schema, l_rec.foreign_table_name); | |
end loop; | |
end; | |
$$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment