cmd命令备份本地postgres数据库以及还原

ps:
1、postgres数据库的备份和还原,前提是都要进来pgadmin安装目录的bin文件夹
2、备份后的文件格式是.bak(其它格式我没有测试过)
3、本命令备份后,也只能用命令的方式还原,其它还原方式测试没有通过。
postgres数据库备份和还原命令-亲测有效
备份命令:pg_dump -h localhost -p 5432 -U postgres -d crcslocalhost> D:\testbackup.bak
口令为你的数据库密码,回车。备份成功。
postgres数据库备份和还原命令-亲测有效
还原命令:psql -h localhost -p 5432 -U postgres -d test02 -f “D:\testbackup.bak”
postgres数据库备份和还原命令-亲测有效
结语:如果有什么错误和不当之处,麻烦指出。感谢x3!

相关文章:

  • 2021-09-09
  • 2021-08-22
  • 2021-09-13
  • 2021-06-29
猜你喜欢
  • 2021-12-20
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-07-10
  • 2022-12-23
相关资源
相似解决方案