PostgreSQL pg_restore 错误:GRANT、REVOKE

PostgreSQL pg_restore errors: GRANT, REVOKE

我尝试使用此命令恢复 PostgreSQL 9.5 数据库:

pg_restore -C -d postgres -U postgres --no-owner --role=jsmith the_data.dump

因为我还原到的集群与进行转储的集群不同,所以一些角色不存在。

还原过程中出现了很多错误,但都涉及GRANTRESTORE。我可以假设实际数据本身已恢复而没有丢失或修改吗?

GRANTREVOKE错误可以忽略。它们不会影响数据加载。

如果您想避免以后收到这些消息,您可以在 pg_restore 上使用 -x 参数(您也可以使用同义词 --no-acl--no-privileges ).

这将停止 pg_restore 尝试设置授权。

pg_restore 文档位于 https://www.postgresql.org/docs/current/static/app-pgrestore.html