的問題是很老了,但是我想分享的有效方法T我找到了帽子。
如果您沒有使用「pg_dump」進行備份,並且您的舊數據是文件夾,請嘗試以下步驟。 在Postgres數據庫中,將記錄添加到「pg_database」表中。使用經理程序或「插入」。 進行必要的檢查並更改以下插入查詢並運行它。
該查詢在工作後會返回一個OID。用此號碼的名稱創建一個文件夾。將舊數據複製到此文件夾後,即可使用。
/*
------------------------------------------
*** Recover From Folder ***
------------------------------------------
Check this table on your own system.
Change the differences below.
*/
INSERT INTO
pg_catalog.pg_catalog(
datname, datdba, encoding, datcollate, datctype, datistemplate, datallowconn,
datconnlimit, datlastsysoid, datfrozenxid, datminmxid, dattablespace, datacl)
VALUES(
-- Write Your collation
'NewDBname', 10, 6, 'Turkish_Turkey.1254', 'Turkish_Turkey.1254',
False, True, -1, 12400, '536', '1', 1663, Null);
/*
Create a folder in the Data directory under the name below New OID.
All old backup files in the directory "data\base\Old OID" are the directory with the new OID number
Copy. The database is now ready for use.
*/
select oid from pg_database a where a.datname = 'NewDBname';
哇,這看起來很容易,明天讓我試試看,我會讓你知道結果。感謝您的快速答案;) – Alvos 2010-07-22 05:47:28
我試過了,它應該工作,但我認爲數據文件夾已損壞,因爲它沒有工作。它應該當數據文件夾是好的,但。我將交易文件作爲備份,恢復歷史數據需要更長的時間,但我認爲我能夠恢復所有內容。它只會花費比我希望的更多的時間。感謝您的幫助。我在測試環境中嘗試了您的解決方案,它確實有效。 – Alvos 2010-07-24 15:36:54
謝謝:)。它運行良好。您只需記住帳戶的密碼是舊安裝的密碼,而不是新密碼。 – Nordes 2011-10-18 08:53:24