当我尝试使用以下方法删除所有表时:
base.metadata.drop_all(engine)
我遇到以下错误:
ERROR:libdl.database_operations:Cannot drop table: (psycopg2.errors.DependentObjectsStillExist) cannot drop sequence <schema>.<sequence> because other objects depend on it
DETAIL: default for table <schema>.<table> column id depends on sequence <schema>.<sequence>
HINT: Use DROP ... CASCADE to drop the dependent objects too.
是否有一种优雅的单线解决方案?
答案 0 :(得分:0)
-O3