Created
August 4, 2017 07:47
-
-
Save philipstanislaus/8006abb547dbfdcfe361f0288de4c8c9 to your computer and use it in GitHub Desktop.
Drop all tables from one schema in Postgres
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 'drop table if exists "' || tablename || '" cascade;' | |
from pg_tables | |
where schemaname = 'public'; -- or any other schema |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment