Postgresql的dump数据库备份与还原

备份

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 -fD://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

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...