Postgresql “pg_restore.exe” taking over a day to complete

半世苍凉 提交于 2020-01-06 07:09:30

问题


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.

When I run pg_restore to a local database (9.6) :

pg_restore.exe -O -x -C -v -f c:/myfilename

The command runs for over 24 hours. (Still running)

Similar to this issue: Postgres Restore taking ages (days)

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.

I prefer using a linux machine, but this is what the client provided. Any suggestions?


回答1:


pg_restore.exe -d {db_name} -O -x c:/myfilename

Did the trick.

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]

see postgres documentation for more.



来源:https://stackoverflow.com/questions/48466676/postgresql-pg-restore-exe-taking-over-a-day-to-complete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!