Skip to main content
Bumped by Community user
added 29 characters in body
Source Link
Nilcale
  • 1
  • 1
  • 3

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.

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. 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.

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.

Source Link
Nilcale
  • 1
  • 1
  • 3

How to forcefully drop all active connections off a database?

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. 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.