数据库的备份和还原:
一:用pgAdmin进行操作。【备份】和【恢复】
二:用pg_dump和pg_restore
命令如下:
su postgres
备份:pg_dump -Ft -b tewoo_ny>/home/backup/20160704.tar
恢复:pg_restore -U tewoo_trade -d tewoo_test_bak -h127.0.0.1/home/backup/20160704.tar
备份为其他格式:
pg_dump -U tewoo_trade-d tewoo_ny -h 127.0.0.1-o >/home/backup/backup.sql
创建数据库:
psql
create databasetewoo_test_bak with encoding = 'UTF-8'owner = tewoo_trade;
原文链接:https://www.f2er.com/postgresql/194475.html