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

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.

主站蜘蛛池模板: 固镇县| 娄底市| 白山市| 正阳县| 瑞安市| 北辰区| 金堂县| 铁力市| 金川县| 保德县| 合江县| 故城县| 即墨市| 文化| 日土县| 云梦县| 保靖县| 元谋县| 铜山县| 莱西市| 仪陇县| 塔河县| 南部县| 乐都县| 舒兰市| 金乡县| 青铜峡市| 曲周县| 大竹县| 紫金县| 玉溪市| 石屏县| 金川县| 乐陵市| 关岭| 西丰县| 米脂县| 临高县| 连州市| 鄂伦春自治旗| 义马市|