【Postgres】dump数据库备份与还原

备份

pg_dump.exe -h localhost -p 5432 -U postgres -F plain -v -f C:\Backup.sql db1 2> C:\Backup.log

还原

psql.exe -h localhost -p 5432 -U postgres -d db1 -f C:\Backup.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