Kill a postgresql session/connection

前端 未结 20 1915
暖寄归人
暖寄归人 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:50

    OSX, Postgres 9.2 (installed with homebrew)

    $ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    $ pg_ctl restart -D /usr/local/var/postgres
    $ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    


    If your datadir is elsewhere you can find out where it is by examining the output of ps aux | grep postgres

提交回复
热议问题