Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 254 Bytes

Snippets I Need.md

File metadata and controls

7 lines (5 loc) · 254 Bytes

Drop all tables from a schema:

DO $$ DECLARE r RECORD; BEGIN FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') LOOP EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE'; END LOOP; END $$;