Skip to content

Instantly share code, notes, and snippets.

@pcbldi
pcbldi / gist:fcdded33cfc454bf5d9f5dd9144b1525
Created December 21, 2018 17:53 — forked from balazs-endresz/gist:f9b27514046506a7db75
Drop all tables and sequences in postgres
# tables for owned by 'tableowner'
select 'drop table if exists "' || tablename || '" cascade;' from pg_tables where tableowner='tableowner';
# all sequences
select 'drop sequence if exists "' || relname || '" cascade;' from pg_class where relkind = 'S';