sql - How do I remove all tables and not the schema in Postgresql? -
i have schema assigned user (jason). can't remove schema don't have permissions so. there nice way remove each tables, data, in schema , make if had freshly created schema. same effect as:
drop schema jason cascade; create schema jason;
but without dropping schema.
try this:
select 'drop table if exists "' || tablename || '" cascade;' pg_tables schemaname = 'jason';
from stackoverflow.com/questions/3327312/drop-all-tables-in-postgresql
and run commands returned!
Comments
Post a Comment