gpt4 book ai didi

postgresql 升级备份和恢复同一个端口

转载 作者:行者123 更新时间:2023-11-29 12:06:44 26 4
gpt4 key购买 nike

在这里,我想将 postgresql 从 8.3(端口 5432)升级到 9.0(端口 5433)如果发生什么情况,

-First I instal the postgres new version 9.0 on port 5433
-Than I backup and restore database by using comman,

/usr/local/pgsql/bin/ pg_dumpall -U -h -p 5432|psql -U -p 5433 -h

-After that I stop both server 8.3 and 9.0
-By using pgAdmin III, I change port the server 9.0 from 5433 to 5432.

如果我尝试以这种方式升级,会发生什么情况?

谢谢:)

最佳答案

这行得通。这也应该比写入文件更快,因为需要的写入次数更少。但请记住将旧数据库置于单用户模式 ​​(postgres --single ...),这样在迁移期间就没有人会写入数据库。

您还可以使用 pg_upgrade就地升级数据库。但是检查 limitations while upgrading from 8.3 .

关于postgresql 升级备份和恢复同一个端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5471068/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com