PostgreSQL: Database backup and Recovery? [closed]

限于喜欢 提交于 2019-12-13 04:39:29

问题


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

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

--Example

pg_dump testdb > backupfile

--Error occurred

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

回答1:


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

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



来源:https://stackoverflow.com/questions/22625162/postgresql-database-backup-and-recovery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!