Kill a postgresql session/connection

前端 未结 20 1925
暖寄归人
暖寄归人 2020-11-28 00:11

How can I kill all my postgresql connections?

I\'m trying a rake db:drop but I get:

ERROR:  database \"database_name\" is being accessed         


        
20条回答
  •  爱一瞬间的悲伤
    2020-11-28 00:28

    Easier and more updated way is:

    1. Use ps -ef | grep postgres to find the connection #
    2. sudo kill -9 "#" of the connection

    Note: There may be identical PID. Killing one kills all.

提交回复
热议问题