Languages
[Edit]
EN

Postgres - drop all public tables in schema

7 points
Created by:
Root-ssh
178290

In this short article, we would like to show how to remove all public tables from the Postgres database.

The main idea of the solution in this article is to generate DROP TABLE ... queries for all public tables and call each query manually.

Steps:

1. Generate DROP TABLE ... queries calling database:

Example result:

Example screenshot:

Dropping all tables query - Postgres.
Dropping all tables query - Postgres.

2. Execute generated drop queries:

Example output:

DONE: database is empty!

Alternative titles

  1. Postgres - remove all public tables in schema
  2. Postgres - delete all public tables in schema
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join