Postgresql之无法删除表(drop table)

来源:互联网 发布:openwrt 修改mac 编辑:程序博客网 时间:2024/05/19 12:38

由于不知道同事是怎么操作表,突然导致表a无法再被访问或通过DB工具打开,这时想先删除表再重建表a导入数据来恢复表a,发现无论是通过工具还是命令都无法删除表a。

出现类似如下提示:

DROP TABLE products;NOTICE:  constraint orders_product_no_fkey on table orders depends on table productsERROR:  cannot drop table products because other objects depend on itHINT:  Use DROP ... CASCADE to drop the dependent objects too.
在http://www.postgresql.org/docs/8.3/static/ddl-depend.html给出了答案,及操作的方法。

原创粉丝点击