postgresql升级备份和恢复相同端口
这里,我想将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.
如果我尝试用这种方式升级会
?谢谢 :)
Here, I want to upgrade postgresql from 8.3(port 5432) to 9.0(port 5433)
Whats happen if,
-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.
Whats happen if I try to upgrade with that way?
thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这会起作用。这也应该比写入文件更快,因为需要更少的写入。但请记住将旧数据库置于单用户模式(
postgres --single ...
),这样在迁移过程中就没有人会写入数据库。您还可以使用 pg_upgrade 就地升级数据库。但请检查从 8.3 升级时的限制。
This would work. This should also be faster than writing to file, as less writes will be needed. But remember to put old database in single user mode (
postgres --single ...
) so nobody would write to the database during migration.You can also use pg_upgrade to upgrade database in place. But check for limitations while upgrading from 8.3.
正如托梅茨基已经说过的,这应该可行。
为了使图片更完整:
在 9.0 中,您还可以使用 pg_upgrade 进行迁移,这应该比使用带有管道的 pg_dump 更快。
As Tometzky has already said, this should work.
Just to make the picture complete:
With 9.0 you can also use pg_upgrade for the migration which should be even faster than using pg_dump with a pipe.