我没有从我的旧数据目录进行备份,但我仍然有目录。在我当前的数据库中,我有相同的Schema等...当我尝试恢复数据库(使用pgadmin III)时,我收到此错误:
/Applications/pgAdmin3.app/Contents/SharedSupport/pg_restore --host localhost -- port 5432 -- username "postgres" --dbname "postgres" --role "postgres" --no-password --format directory --verbose "/Library/Postgres/9.5/data"
pg_restore: [directory archiver] could not open input file "/Library/PostgreSQL/9.5/data/toc.dat": No such file or directory
我不确定toc.dat在哪里发挥作用,因为我不熟悉它。这显然是暂停恢复,但我不知道如何解决这个问题。
恢复时不要在参数中使用--format。
使用3.0版本的pgAdmin 4
可能为时已晚,但这一直对我有用。
从Current或Old数据库
Backup...
;filename
,并确保从下拉菜单中将format
设置为Tar;保存备份文件后
在新数据库或其他数据库上(或在不同的计算机上)
创建一个新数据库并在创建后右键单击它,选择Restore...
选项并找到之前创建的Backup
up文件。您可能必须选择
Show hidden files and folders
选项并将Format
设置为All Files
使用此方法不应该出现该错误。