- Drop
& Create The schema
DROP SCHEMA <schema_name> CASCADE;
CREATE SCHEMA <schema_name>;
- Selectively
Delete the tables
SELECT
'drop table if exists "' || tablename
|| '" cascade;' as pg_drop
FROM
pg_tables
WHERE
schemaname= <schema_name>;
References
01. https://stackoverflow.com/questions/3327312/drop-all-tables-in-postgresql
02. https://skyvia.com/gallery/drop-all-tables-in-postgresql
No comments:
Post a Comment