Postgresql“pg_restore.exe"耗时一天完成 [英] Postgresql "pg_restore.exe" taking over a day to complete
问题描述
我使用的是 Windows Server 2016 机器.我已经使用 -Fc 格式在 3gb postgres 9.4 数据库上运行 pg_dump.exe.
I'm on a Windows Server 2016 machine. I have run pg_dump.exe on a 3gb postgres 9.4 database using the -Fc format.
当我将 pg_restore 运行到本地数据库 (9.6) 时:
When I run pg_restore to a local database (9.6):
pg_restore.exe -O -x -C -v -f c:/myfilename
该命令运行超过 24 小时.(仍在运行)
The command runs for over 24 hours. (Still running)
与此问题类似:Postgres 恢复时间(天)
我正在使用详细的 cli 选项,它看起来会吐出很多 JSON.我假设它被插入到表格中.任务管理器的 CPU 为 0%,使用 0.06MB 内存.看来下次我应该增加更多工作,但这似乎仍然很荒谬.
I am using the verbose cli option, which looks to be spitting out a lot of JSON. I'm assuming that's getting inserted into tables. The task manager has the CPU at 0%, using .06MB of memory. Looks like I should add more jobs next time, but this still seems pretty ridiculous.
我更喜欢使用 linux 机器,但这是客户端提供的.有什么建议吗?
I prefer using a linux machine, but this is what the client provided. Any suggestions?
推荐答案
pg_restore.exe -d {db_name} -O -x c:/myfilename
成功了.
我去掉了 -C
并在运行命令之前手动创建了数据库.我还意识到连接选项应该在其他选项之前:
I got rid of the -C
and manually created the database prior to running the command. I also realized that connection options should come before other options:
pg_restore [connection-option...] [option...] [filename]
有关更多信息,请参阅 postgres 文档.
see postgres documentation for more.
这篇关于Postgresql“pg_restore.exe"耗时一天完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!