Last active
August 21, 2022 03:55
-
-
Save stevehenderson/35372794c838572e634a71790f05d515 to your computer and use it in GitHub Desktop.
Cascade drop all tables in a SQL/PostgreSQL schema
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
-- You will need to remove some quotation marks | |
select 'drop table if exists "schema_name"."' || tablename || '" cascade;' | |
from pg_tables | |
where schemaname = 'schema_name'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment