官术网_书友最值得收藏!

Stopping the server in an emergency

In this recipe, we will show you the command that can be used to stop the server in an emergency situation.

How to do it...

We can use the following command to stop the PostgreSQL server in an emergency:

pg_ctl -D /var/lib/pgsql/9.6/data stop -m immediate

Here, the data directory location is defined at /var/lib/pgsql/9.6/data.

How it works...

The moment the immediate stop mode is used with the pg_ctl command, all the users have their transactions aborted and the existing connections are terminated. There is no system checkpoint either and the database basically requires crash recovery at the time of database restart.

In this shutdown mode, the PostgresSQL process will issue a direct SIGQUIT signal to each of the child processes, by including the backend processes such as bgwriter, autovacuum, and recovery processes. However, in smart shutdown mode, the PostgreSQL process will wait until these processes are terminated and then shut down the postmaster process.

主站蜘蛛池模板: 连云港市| 咸丰县| 邻水| 盱眙县| 麦盖提县| 开化县| 抚顺县| 和林格尔县| 邢台县| 武川县| 咸阳市| 乌拉特后旗| 印江| 墨竹工卡县| 临夏县| 尉氏县| 竹溪县| 菏泽市| 青浦区| 肇州县| 准格尔旗| 商都县| 内丘县| 兴仁县| 仁寿县| 许昌县| 康保县| 礼泉县| 德格县| 武平县| 小金县| 温宿县| 慈溪市| 济阳县| 宜黄县| 韶关市| 龙陵县| 洛川县| 噶尔县| 武清区| 东明县|