Skip to content

Instantly share code, notes, and snippets.

@spacewander
Created May 15, 2018 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacewander/848af646e91eeecef386fbc436285947 to your computer and use it in GitHub Desktop.
Save spacewander/848af646e91eeecef386fbc436285947 to your computer and use it in GitHub Desktop.
my pgsql collection
-- drop all table in a database
select string_agg('drop table "' || tablename || '" cascade', ';') from pg_tables where schemaname = 'public';
-- copy the ouput and execute it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment