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

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.

主站蜘蛛池模板: 贵州省| 稷山县| 长顺县| 鲜城| 承德县| 莒南县| 敦化市| 定南县| 江陵县| 皮山县| 休宁县| 平原县| 沽源县| 大埔县| 永吉县| 鄂州市| 吉木乃县| 康平县| 忻州市| 临潭县| 大渡口区| 永修县| 库伦旗| 凤山县| 松江区| 固原市| 封开县| 沁水县| 玉田县| 奉节县| 双鸭山市| 阿坝县| 桦甸市| 武穴市| 新密市| 古交市| 腾冲县| 都安| 济南市| 西畴县| 千阳县|