Postgres数据库备份与还原命令

备份

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

还原

psql.exe -h 127.0.0.1 -U postgres -d testdb001 -E -f "f:	estdb001.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
原文地址:https://www.cnblogs.com/winkey4986/p/5368173.html