[英]pg_dumpall excluding some tables
I want to get a full backup of postgres 9.6. 我想完整备份postgres 9.6。 Including the users and permissions.
包括用户和权限。 However I want to exclude some tables.
但是我想排除一些表。 In
pg_dump
there is an option for excluding some tables ( -T
). 在
pg_dump
有一个排除某些表的选项( -T
)。 However in pg_dumpall
there are no such options. 但是在
pg_dumpall
中没有这样的选项。
Is there a way for getting a backup like this in a single command? 有没有办法在单个命令中获得像这样的备份? Or should I get
pg_dumpall
(without tables) and pg_dump
with -T
? 或者我应该用
-T
得到pg_dumpall
(没有表)和pg_dump
? However in the second scenario these two dumps are not completely synchronised. 但是,在第二种情况下,这两个转储没有完全同步。
You'll have to use pg_dumpall -g
and pg_dump -T
. 您必须使用
pg_dumpall -g
和pg_dump -T
。
True, the dumps will not share a single snapshot, but unless you add, modify or delete users and tablespaces very frequently, that should not be a problem in practice. 的确,转储不会共享单个快照,但是除非您非常频繁地添加,修改或删除用户和表空间,否则实际上这不是问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.