的问题是很老了,但是我想分享的有效方法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