On one server I have a Postgresql database and there're many clients on other servers accross the internet that connect to it. I want to drop all the active connections on demand, they should be dropped forcefully and for N minutes. Then I'll do some maintance work on a database and then allow clients to reconnect.
I don't have control over the clients accross the internet, hence, forceful way of dropping connections. There're also local clients. Postgresql service should remain active.
How can I do it?
And I'd prefer to refrain from changing the Postgresql config files to make the connections drop off, the settings such as "allow only connections on local <> all
interface(s)". Although, this might be the easiest way to achive the goal? But there're also clients who connect on the local interface, even psql
itself.