Guido
Guido

Reputation: 103

List tables in logical order of dependecies

Well, I need to list all tables of my postgres database in logical order to delete data without any problems with of foreign keys.

How can I find that kind of information?

Only I need to list tables name. No more information.

Thanks in advance

Upvotes: 0

Views: 170

Answers (1)

Tomas Greif
Tomas Greif

Reputation: 22663

If you need to delete data then there is the following similar question: delete data cascade

If you would like to drop tables then use drop table x cascade? docs Using CASCADE postgres will automatically drop all dependent objects - tables, views, ...

Upvotes: 1

Related Questions