偶爾在我們的實驗室,我們的Postgres 8.3數據庫將得到pid文件孤立的,我們在嘗試關閉數據庫時,這條消息:我如何優雅地殺掉舊的服務器進程Postgres的
Error: pid file is invalid, please manually kill the stale server process postgres
發生這種情況時,我們立即執行pg_dump
,以便稍後恢復數據庫。但是,如果我們只是殺掉孤兒postgres
進程然後啓動它,那麼數據庫將僅使用上次成功關閉的數據啓動。但是如果你在殺死它之前給它psql
,數據全部可用,那麼爲什麼pg_dump
有效。
有沒有辦法正常關閉孤立的postgres進程,所以我們不必經過pg_dump和恢復?或者是否有辦法在殺死孤立進程後恢復數據庫?
爲什麼不用-9? – Magne 2013-12-09 09:33:51