1DROP SCHEMA public CASCADE;
2CREATE SCHEMA public;
3
4GRANT ALL ON SCHEMA public TO postgres;
5GRANT ALL ON SCHEMA public TO public;
1DO $$
2 DECLARE
3 r RECORD;
4BEGIN
5 FOR r IN
6 (
7 SELECT table_name
8 FROM information_schema.tables
9 WHERE table_schema=current_schema()
10 )
11 LOOP
12 EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.table_name) || ' CASCADE';
13 END LOOP;
14END $$ ;