备份
pg_dump.exe -h localhost -p 5432 -U postgres -F plain -v -f C:\Backup.sql db1 2> C:\Backup.log
pg_dump -U postgres DB001 > D://DB001.dmp
还原
psql.exe -h localhost -p 5432 -U postgres -d db1 -f C:\Backup.sql
psql -U postgres -d NEWDB001 -f D://DB001.dmp
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
本文介绍了使用pg_dump和psql命令进行PostgreSQL数据库备份与还原的方法。包括全库备份、指定数据库备份及还原操作的具体命令示例。
6557

被折叠的 条评论
为什么被折叠?



