最佳答案
我正在使用 Heroku 和 Crane Postgres 选项,当我的本地机器崩溃时,我正在对数据库进行查询。如果我逃跑
select * from pg_stat_activity
其中一个条目
<IDLE> in transaction
在 current _ query _ text 列中。
As a result, I can't drop the table that was being written to by the query that was terminated. I have tried using pg_cancel_backend(N) and it returns True but nothing seems to happen.
如何终止此进程以便删除表?