开发者社区> 问答> 正文

take backup of the database in PostgreSQL?

已解决

How will you take backup of the database in PostgreSQL?

展开
收起
1780169608831412 2021-10-16 15:07:27 513 0
1 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。
    采纳回答

    We can achieve this by using the pg_dump tool for dumping all object contents in the database into a single file. The steps are as follows:

    Step 1: Navigate to the bin folder of the PostgreSQL installation path.

    C:\>cd C:\Program Files\PostgreSQL\10.0\bin
    
    

    Step 2: Execute pg_dump program to take the dump of data to a .tar folder as shown below:

    pg_dump -U postgres -W -F t sample_data >
    C:\Users\admin\pgbackup\sample_data.tar
    

    The database dump will be stored in the sample_data.tar file on the location specified.

    2021-10-16 16:32:51
    赞同 1 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Oracle 至PostgreSQL案例分享 立即下载
PostgresChina2018_杨杰_PostgreSQL-Flashback_Query实现与介绍 立即下载
Bringing MySQL Compatibility to HBase using Database Virtualization 立即下载