PostgreSQL停止動作觀察

2021-09-06 10:54:44 字數 2359 閱讀 8258

實驗過程如下:

啟動乙個客戶端:

[

postgres@cnrd56 bin

]$ ./

psql

psql (

9.1.2

)type "help"

forhelp.

postgres

=# begin

;begin

postgres

=# select

count(*), pg_sleep(1000) from test;

然後強制停止:

pg_ctl stop -m f  -d /usr/local/pgsql/data

此時在客戶端出現如下資訊:

fatal:  terminating connection due to

administrator command

the connection

tothe server was lost. attempting reset: failed.

!>

再看後台的log:

2013-07

-1410:17:17.280 cst,,,3422,,51e209eb.d5e,2,,2013-07

-1410:16:11 cst,,0,log,00000,"received fast shutdown

request",,,,,,,,,""

2013-07

-1410:17:17.280 cst,,,3422,,51e209eb.d5e,3,,2013-07

-1410:16:11 cst,,0,log,00000,"aborting any

active transactions",,,,,,,,,""

2013-07

-1410:17:17.280 cst,,,3427,,51e209ec.d63,2,,2013-07

-1410:16:12 cst,1

/0,0,log,00000

,"autovacuum launcher shutting down",,,,,,,,,""

2013-07

-1410:17:17.280 cst,"postgres","postgres",3431,"[

local

]",51e209ff.d67,1,"select",2013-07

-1410:16:31 cst,2

/2,0,fatal,57p01,"terminating connection due to administrator command",,,,,,"select

count(*), pg_sleep(1000) from

test;",,,"psql"

2013-07

-1410:17:17.281 cst,,,3425,,51e209ec.d61,1,,2013-07

-1410:16:12 cst,,0,log,00000

,"shutting down",,,,,,,,,""

2013-07

-1410:17:17.281 cst,"postgres","postgres",3435,"[

local

]",51e20a2d.d6b,1,"",2013-07

-1410:17:17 cst,,0,fatal,57p03,"the database system is

shutting down",,,,,,,,,""

2013-07

-1410:17:17.284 cst,,,3425,,51e209ec.d61,2,,2013-07

-1410:16:12 cst,,0,log,00000,"database system is shut down",,,,,,,,,""

其中的:

2013-07

-1410:17:17.280 cst,"postgres","postgres",3431,"[

local

]",51e209ff.d67,1,"select",2013-07

-1410:16:31 cst,2

/2,0,fatal,57p01,"terminating connection due to administrator command",,,,,,"select

count(*), pg_sleep(1000) from test;",,,"psql"

表明,客戶端正在執行sql文 select count(*), pg_sleep(1000) from test的時候,

收到了 "terminating connection due to administrator command" 命令。

PostgreSQL停止動作觀察

實驗過程如下 啟動乙個客戶端 postgres cnrd56 bin psql psql 9.1.2 type help forhelp.postgres begin begin postgres select count pg sleep 1000 from test 然後強制停止 pg ctl ...

postgresql 啟動停止方式

啟動和停止資料庫伺服器 service postgresql 10 start service postgresql 10 stop service postgresql 10 statuspg ctl start d data 所在路徑 pg ctl stop d data 所在路徑 三種形式 m...

vim巨集避免E486錯誤停止巨集動作

正則沒有匹配到資料 自己在錄製巨集的時候,中間有替換字串的操作,如果出現替換的字串不存在就會導致整個巨集就停止下來了。這樣不是我想要的。解決辦法加 e引數 詳細看幫助 help s flag e 如果模式搜尋不成功,不給出錯誤資訊。因為沒產生錯誤,對映的過程得以繼 續。這主要用來防止在對映執行過程的...