PostgreSQL:数据库备份和恢复? [英] PostgreSQL: Database backup and Recovery?

查看:159
本文介绍了PostgreSQL:数据库备份和恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PostgreSQL 9.3中进行数据库备份和恢复的过程是什么?

What is the procedure to take database backup and recovery in PostgreSQL 9.3?

我正在使用SQL Dump进行相同的操作,但是在pg_dump附近出现了错误。

I am using SQL Dump for the same, but getting an error near pg_dump.

-示例

pg_dump testdb > backupfile

-发生错误

ERROR:  syntax error at or near "pg_dump"  
LINE 1: pg_dump testdb > backupfile  


推荐答案

使用以下命令在本地进行数据库备份

Use below command to take Database backup locally

pg_dump -U postgres -h 127.0.0.1 -p 5432 -Fc -f FileName.backup -w DBName

如果要远程备份数据库,则可以使用远程IPAddress代替127.0.0.1。

If you want to take database backup remotely Than use Remote IPAddress in place of 127.0.0.1.

这篇关于PostgreSQL:数据库备份和恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆