1. Home
  2. Knowledge Base
  3. PostgreSQL
  4. Stopping PostgreSQL in an Emergency
  1. Home
  2. Knowledge Base
  3. PostgreSQL DBA
  4. Stopping PostgreSQL in an Emergency

Stopping PostgreSQL in an Emergency

How to stop PostgreSQL in an emergency?


Sometimes DBAs need to stop PostgreSQL Server on an emergency notice. In such situations, DBAs cannot even wait for client connections to close gracefully, This post is for such scenarios:

Step 1: The basic command to stop the PostgreSQL server is as follows:

Step 2: On Debian/Ubuntu, you can also use the following command:

pg_ctlcluster -m (immediate option) will immediately terminate/abort all the transactions and connections. This method is so similar to a PostgreSQL Server crash and the system will undergo crash recovery with a few cached files will be rebuilt.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support