I have a rails application running over Postgres.
I have two servers: one for testing and the other for production.
Very often I need to clone the production
Easier and more updated way is: 1. Use ps -ef | grep postgres to find the connection # 2. sudo kill -9 "# of the connection
ps -ef | grep postgres
sudo kill -9 "# of the connection
Note: There may be identical PID. Killing one kills all.