开发者

Programmatically drop all connections

开发者 https://www.devze.com 2023-01-11 13:23 出处:网络
At work, we do distributed testing, where rsync out to everyone elses machine and distribute out test files to speed up the testing p开发者_如何学Crocess. One issue we are running into is that if some

At work, we do distributed testing, where rsync out to everyone elses machine and distribute out test files to speed up the testing p开发者_如何学Crocess. One issue we are running into is that if someone has an instance of pgadmin open, it won't let us reset the test database due to connections being open.

Is there any way we can programmatically kill connections in either ruby or pg that doesn't involve restarting the daemon?


Use pg_terminate_backend() to kill the connections you want to kill.

0

精彩评论

暂无评论...
验证码 换一张
取 消