Postgres数据库备份与还原命令

备份

pg_dump.exe -c -b -E UTF8 -U postgres -h 127.0.0.1 -p 5432 -f "f:\testdb001.bak" testdb001

还原

psql.exe -h 127.0.0.1 -U postgres -d testdb001 -E -f "f:\testdb001.bak"

 

--Linux
pg_dump -U postgres -c -C --if-exists -d cmsss -f F:/cmsss.sql

 

SQL备份

pg_dumpall.exe -h localhost -p 5432 -U postgres -v -f C:\All.sql 2> C:\All.log

SQL还原

psql.exe -h localhost -p 5432 -U postgres -f C:\All.sql
posted @ 2016-04-08 15:03  人生如若初见  阅读(2850)  评论(0编辑  收藏  举报