pg_dump -Fc 导出的自定义格式数据库文件 相关操作

目录

实例

  • 将 test.dmp 文件转换为普通SQL内容, 并打印到屏幕
pg_restore -U postgres -Fc -f - test.dump
  • 将 test.dmp 文件转换为普通SQL内容, 并输出到 test.sql 文件中
pg_restore -U postgres  -Fc -f test.sql  test.dump
  • 备份得到自定义格式的数据库文件(dmp)
pg_dump -U postgres -Fc -f test.dmp test
  • 恢复备份的 dmp 文件
drop database test;
CREATE DATABASE test WITH TEMPLATE = template0 ENCODING = 'UTF8'  LOCALE = 'C';
pg_restore -U postgres -d test test.dmp
posted @   岳麓丹枫  阅读(28)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示