Drop all tables in PostgreSQL

PostgreSQL

 

A well-known open-source database, developed by PostgreSQL Global Development Group. Skyvia requires the server to be available from Internet. Skyvia supports PostgreSQL, EnterpriseDB, Pervasive Postgres SQL servers, Heroku Postgres.

SELECT statement which constructs a 'drop table' instruction for each table found in the schema

Query Text

SELECT
    'drop table if exists "' || tablename || '" cascade;' as pg_drop
FROM 
    pg_tables
WHERE
    schemaname='your schema';
  

Open Query