iMac:slavehs$ pg_ctl -D . restart waiting for server to shut down... LOG: received smart shutdown request FATAL: terminating walreceiver process due to administrator command LOG: shutting down LOG: database system is shut down done server stopped server starting LOG: database system was shut...
waiting for server to shut down...2023-10-19 16:48:11.635 CST [38852] LOG: received smart shutdown request ... 这里窗口2无法完成数据库关闭,因为窗口1此时有活动连接 将窗口1连接的用户退出 testdb=# exit 2 [postgres@ora19c02 ~]$ 此时窗口2立即关闭成功 2023-10-19 16:48:22.673 CST [3885...
[postgres@pghost1~]$ kill -sigterm `head -1 /pgdata/10/data/postmaster.pid` received smart shutdown request shutting down database system is shut down 通过日志输出可以看到该命令是通过smart关闭数据库的。它内部的原理可以查看PostgreSQL内核相关的书籍或者阅读源码中pqsignal和pmdie相关的代码进行了解。
2.1 smart 窗口1:打开一个链接 [postgres@ora19c02~]$ psql-d testdb psql(15.4)Type"help"forhelp.testdb=# 窗口2:执行关闭命令 [postgres@ora19c02~]$ pg_ctl stop-m smart waitingforservertoshut down...2023-10-1916:48:11.635CST[38852]LOG: received smartshutdownrequest... 这里窗口2无法完成...
[postgres@localhost ~]$ pg_ctl stop -o SIGTERM LOG: received smart shutdown request LOG: autovacuum launcher shutting down waiting for server to shut down...LOG: shutting down LOG: database system is shut down done server stopped [postgres@localhost ~]$ 最...
LOG: received fast shutdown request LOG: aborting any active transactions FATAL: terminating connection due to administrator command LOG: shutting down LOG: database system is shut down 会话被强制中断,然后关闭数据库。起⼀个事务,然后测试关闭:postgres=# create table t(id int primary key, name ...
LOG: received smart shutdown request LOG: autovacuum launcher shutting down waiting for server to shut down...LOG: shutting down LOG: database system is shut down done server stopped [postgres@localhost ~]$ 最快速关闭方法:killpostgres进程 [...
waiting for server to shut down...2023-10-19 16:48:11.635 CST [38852] LOG: received smart shutdown request ... 1. 2. 3. 这里窗口2无法完成数据库关闭,因为窗口1此时有活动连接 将窗口1连接的用户退出 testdb=# exit 2 [postgres@ora19c02 ~]$ 1. 2. 此时...
LOG: received smart shutdown request LOG: autovacuum launcher shutting down waiting for server to shut down...LOG: shutting down LOG: database system is shut down done server stopped [postgres@localhost ~]$ 最快速关闭方法:kill postgres 进程 [...
[postgres@localhost ~]$ pg_ctl stop -o SIGTERM LOG: received smart shutdown request LOG: autovacuum launcher shutting down waiting for server to shut down...LOG: shutting down LOG: database system is shut down done server stopped [postgres@localhost ~]$ 最...