Skip to content

Instantly share code, notes, and snippets.

@danazkari
Last active July 28, 2019 20:12
Show Gist options
  • Save danazkari/c5485ab375e5686bab9430a64af0ddac to your computer and use it in GitHub Desktop.
Save danazkari/c5485ab375e5686bab9430a64af0ddac to your computer and use it in GitHub Desktop.
delete tables from public schema postgres
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