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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -