小编dav*_*rez的帖子

不支持并行 pg_restore

我已经多次使用这种技术在服务器之间传输数据库:

\n\n
pg_dump --no-owner -Fd mydb -j 4 -f tmp/mydb\nscp -r tmp/mydb otherserver:tmp/\n
Run Code Online (Sandbox Code Playgroud)\n\n

然后在另一台服务器中:

\n\n
dropdb --if-exists mydb && \ncreatedb -T template0 mydb && \npg_restore -j 4 -d mydb tmp/mydb && \nrm -rf tmp/mydb\n
Run Code Online (Sandbox Code Playgroud)\n\n

它运行完美。\n使用 Postgres 9.3.16 和 CentOS 7。

\n\n

但现在,在新服务器中,pg_restore 抱怨:

\n\n
pg_restore: [archiver] parallel restore is not supported with this archive file format\n
Run Code Online (Sandbox Code Playgroud)\n\n

我可以删除该-j 4参数,但理论上它应该是有效的。\n根据pg_restore 文档

\n\n
\n

-j 作业数\n --jobs=作业数

\n\n

运行 pg_restore \xe2\x80\x94 中最耗时的部分,这些部分使用多个并发作业加载\n 数据、创建索引或创建约束 \xe2\x80\x94。此选项可以显着减少将大型数据库恢复到多处理器计算机上运行的服务器的时间。

\n\n

每个作业都是一个进程或一个线程,具体取决于操作系统,并使用与服务器的单独连接。 …

postgresql postgresql-9.3

5
推荐指数
1
解决办法
2291
查看次数

标签 统计

postgresql ×1

postgresql-9.3 ×1