2017-04-03 42 views
1

我試圖用這個命令來恢復一個PostgreSQL 9.5數據庫:的PostgreSQL pg_restore的錯誤:GRANT,REVOKE

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

因爲我恢復到集羣是不一樣的轉儲作出的集羣,一些角色不存在。

恢復過程中出現很多錯誤,但都涉及到GRANTRESTORE。我能否假設實際數據本身在不丟失或修改的情況下被恢復?

+1

這些消息

pg_restore的文檔通常警告不是錯誤。是的,你可以忽略它們。 –

回答

2

GRANTREVOKE錯誤可以忽略。它們不影響數據加載。

如果你想避免在將來你可以使用pg_restore-x參數(你也可以用同義詞或--no-acl--no-privileges )的消息。

這會停止pg_restore嘗試設置授權。在https://www.postgresql.org/docs/current/static/app-pgrestore.html

+0

謝謝。我確實在[this comment]中看到了'--no-privileges'選項(http://stackoverflow.com/questions/37271402/pg-restore-error-role-xxx-does-not-exist#comment72931604_37271854),雖然只有在我運行恢復命令後。 – user1071847