加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

pg_dump备份压缩

发布时间:2020-12-13 16:25:23 所属栏目:百科 来源:网络整理
导读:在执行我应该使用的pg_dump时,为什么? pg_dump -U user 数据库 | gzip -c backup.gz 要么 pg_dump -F c -f backup.tar.gz -U user 数据库 根据 pg_dump documentation,自定义格式为: the most flexible output format in that it allows manual selection
在执行我应该使用的pg_dump时,为什么?

pg_dump -U< user> <数据库> | gzip -c> backup.gz

要么

pg_dump -F c -f backup.tar.gz -U< user> <数据库>

根据 pg_dump documentation,自定义格式为:

the most flexible output format in that it allows manual selection and
reordering of archived items during restore. This format is also
compressed by default

您还可以使用-Z选项选择压缩级别.

为简单起见,我肯定会选择pg_dump -F c而不是gzip.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读