-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

PostgreSQL 10 Administration Cookbook

If nothing else is working, we may need to stop the server quickly, without caring about disconnecting the clients gently.
Break the glass in case of emergency!
pg_ctl -D datadir stop -m immediate
pg_ctlcluster 10 main stop -m immediate
As mentioned in the previous recipe, this is just a wrapper around pg_ctl
. From this example, we can see that it can pass through the -m immediate
option.
In the previous recipe, we have seen examples where the systemctl
command was used to stop a server safely; however, that command cannot be used to perform an emergency stop.
When you do an immediate stop, all users have their transactions aborted and all connections are disconnected. There is no clean shutdown, nor is there politeness of any kind.
An immediate mode stop is similar to a database crash. Some cached files will need to be...