码迷,mamicode.com
首页 > 数据库 > 详细

postgres 数据库备份(保证pg_dump的命令是全局的)

时间:2019-10-20 20:00:00      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:pgp   端口   数据   linux   shell   win   export   备份   set   

  • 数据库备份命令

    • window
    set pgpassword=密码
    pg_dump -h 主机 -p 端口 -U 用户 -d 数据库 -t 表 -a > 文件地址  (只备份数据)
    pg_dump -h 主机 -p 端口 -U 用户 -d 数据库 -t 表 -a > 文件地址 --column-inserts (只备份数据)
    • linux
    export pgpassword=密码
    pg_dump -h 主机 -p 端口 -U 用户 -d 数据库 -t 表 -a > 文件地址  (只备份数据)
    pg_dump -h 主机 -p 端口 -U 用户 -d 数据库 -t 表 -a > 文件地址 --column-inserts (只备份数据)

postgres 数据库备份(保证pg_dump的命令是全局的)

标签:pgp   端口   数据   linux   shell   win   export   备份   set   

原文地址:https://www.cnblogs.com/MyUniverse/p/11708614.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!