Skip to content

Instantly share code, notes, and snippets.

@ophentis
Created April 9, 2017 17:20
Show Gist options
  • Save ophentis/812fac5eb9f0589c16b8666a9a1a87d7 to your computer and use it in GitHub Desktop.
Save ophentis/812fac5eb9f0589c16b8666a9a1a87d7 to your computer and use it in GitHub Desktop.
postgresql drop table generator
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