我尝试过pg_dump
,然后在另一台机器上尝试导入 sql 并填充数据库,我看到了
CREATE TABLE
ERROR: role "prod" does not exist
CREATE TABLE
ERROR: role "prod" does not exist
CREATE TABLE
ERROR: role "prod" does not exist
CREATE TABLE
ERROR: role "prod" does not exist
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
WARNING: no privileges could be revoked for "public"
REVOKE
ERROR: role "postgres" does not exist
ERROR: role "postgres" does not exist
WARNING: no privileges were granted for "public"
GRANT
这意味着我的user
和roles
和grant
信息不在pg_dump
另一方面,我们有pg_dumpall
,我阅读对话,这不会带我去任何地方吗?
问题
- 我应该将哪一个用于数据库备份?pg_dump
还是pg_dumpall
?
- 要求是我可以进行备份并且应该能够导入任何机器并且它应该可以正常工作。