Drop All Table Postgresql

[Solved] Drop All Table Postgresql | Sql - Code Explorer | yomemimo.com
Question : force drop all tables postgres

Answered by : zahid-hasan

DROP SCHEMA public CASCADE;
CREATE SCHEMA public;

Source : | Last Update : Thu, 03 Dec 20

Question : how to drop all tables in postgresql

Answered by : gugulothu-nagaraju

DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;

Source : https://makandracards.com/makandra/62111-how-to-drop-all-tables-in-postgresql | Last Update : Tue, 10 Aug 21

Question : postgres drop all tables

Answered by : naughty-nightingale-c5jlougjxck0

DO $$ DECLARE r RECORD;
BEGIN FOR r IN ( SELECT table_name FROM information_schema.tables WHERE table_schema=current_schema() ) LOOP EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.table_name) || ' CASCADE'; END LOOP;
END $$ ;

Source : https://kags.me.ke/post/postgresql-how-to-drop-all-tables/ | Last Update : Wed, 15 Sep 21

Answers related to drop all table postgresql

Code Explorer Popular Question For Sql