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!
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!
The basic command to perform an emergency stop on the server is the following:
pg_ctl -D datadir stop -m immediate
On Debian/Ubuntu, you can also use:
pg_ctlcluster 9.6 main stop -m immediate
As mentioned in the previous recipe, this is just a wrapper around pg_ctl. From this example, we see that it can pass through the -m immediate option.