- PostgreSQL High Performance Cookbook
- Chitij Chauhan Dinesh Kumar
- 233字
- 2021-07-09 18:47:21
Stopping the server quickly
There are different modes available to stop the PostgreSQL server. Here we will talk about the mode in which we can stop the server quickly.
Getting ready
The pg_ctl
command is used in combination with the stop option in order to stop the PostgreSQL server.
How to do it...
We can use the following command to stop the server quickly on Red Hat-based Linux distributions and other Unix-based systems:
pg_ctl -D /var/lib/pgsql/9.6/data -m fast stop
Here, /var/lib/pgsql/9.6/data
is the location of the data directory.
How it works...
The -m
fast option must be used in order to shut down as quickly as possible. In case of a normal shutdown, PostgreSQL will wait for all users to finish their transactions before halting and on a busy system this can sometimes take a very long time.
While initiating a fast stop with the -m
fast option of the pg_ctl
command, all the users will have their transactions aborted and all connections are disconnected. However, this is a clean shutdown because all the active transactions are aborted followed, by a system checkpoint before the server closes.
Also, it will verify various checks, such as whether PostgreSQL has started in a single user mode or whether the cluster is running in backup mode while shutting down the database, and will interact with the user by throwing the required notification messages.
- Hands-On Intelligent Agents with OpenAI Gym
- Ansible Quick Start Guide
- 蕩胸生層云:C語言開發(fā)修行實錄
- Visual FoxPro 6.0數(shù)據(jù)庫與程序設(shè)計
- 輕松學Java
- 返璞歸真:UNIX技術(shù)內(nèi)幕
- 模型制作
- 大數(shù)據(jù)挑戰(zhàn)與NoSQL數(shù)據(jù)庫技術(shù)
- DevOps:Continuous Delivery,Integration,and Deployment with DevOps
- C#求職寶典
- PHP求職寶典
- 計算機辦公應用培訓教程
- 智能小車機器人制作大全(第2版)
- SolarWinds Server & Application Monitor:Deployment and Administration
- Internet of Things with Raspberry Pi 3