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

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.

主站蜘蛛池模板: 平潭县| 虎林市| 宜良县| 光山县| 攀枝花市| 淳化县| 吉隆县| 北宁市| 松江区| 卢湾区| 沙田区| 平邑县| 龙泉市| 兴义市| 商水县| 拉孜县| 伊金霍洛旗| 万全县| 桐梓县| 玉龙| 炎陵县| 罗江县| 嵩明县| 大理市| 翁牛特旗| 齐齐哈尔市| 安化县| 新安县| 衡阳市| 信宜市| 新密市| 南安市| 龙游县| 四子王旗| 体育| 平原县| 微山县| 宝坻区| 合作市| 江津市| 咸宁市|