如何杀死我所有的postgresql连接?杀死postgresql会话/连接
我想一个rake db:drop
但我得到:
ERROR: database "database_name" is being accessed by other users
DETAIL: There are 1 other session(s) using the database.
我试图关闭我从ps -ef | grep postgres
看到的过程,但这个不起作用或者:
kill: kill 2358 failed: operation not permitted
注意,在Postgres 9.2,procpid被重命名为pid。 – Devin 2012-12-04 22:39:44
谢谢!把它变成一个耙子任务:https://gist.github.com/mfilej/5943114 – mfilej 2013-07-07 11:11:09
如果他是一个超级用户,不管他有没有'sudo'-ed杀了? – ndn 2016-03-11 14:45:47