cannot drop table users because other objects depend on it

前端 未结 3 1719
不知归路
不知归路 2021-02-05 00:36

I want to drop my tables in database. But, when I use, for example, DROP TABLE if exists users; I receive this message:

cannot drop tab

3条回答
  •  无人共我
    2021-02-05 00:52

    Use the cascade option:

    DROP TABLE if exists users cascade;
    

    this will drop any foreign key that is referencing the users table or any view using it.

    It will not drop other tables (or delete rows from them).

提交回复
热议问题