Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save borland667/6031174eb632f12a46e0b8accb87ab1d to your computer and use it in GitHub Desktop.
Save borland667/6031174eb632f12a46e0b8accb87ab1d to your computer and use it in GitHub Desktop.
DO $$
DECLARE
r RECORD;
BEGIN
FOR r IN
(
SELECT table_name
FROM information_schema.tables
WHERE table_schema=current_schema()
)
LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.table_name) || ' CASCADE';
END LOOP;
END $$ ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment