postgresql - 我如何在 ubuntu 16.04 上将我的 Postgresql 9.5 升级到 Postgresql 10

标签 postgresql ubuntu-16.04

<分区>

我有一台运行 postgresql 9.5 的 ubuntu 机器,大约有 12 GB 的数据。现在我想将我的 postgresql 版本从 9.5 升级到 10。我用谷歌搜索了一些文章但无法升级,还有一件事我不想完全卸载 postgres 9.5 并安装 postgres 10。我的 postgresql 9.5 设置是:

1-Postgresql 配置文件位于:

/opt/PostgreSQL/9.5/

2- Postgresql 10 安装位置

/etc/postgresql/10

最佳答案

在 Debian 或 Ubuntu 上升级的正常过程是这样的:

停止 PostreSQL 的新更新版本:

service postgresql stop

删除新的更新版本集群以确保里面没有任何东西:

pg_dropcluster --stop 10 main

然后数据迁移:

pg_upgradecluster -m upgrade 9.5 main

然后停止以前版本的 PotsgreSQL :

pg_dropcluster 9.5 main --stop

删除旧版本:

apt-get autoremove --purge postgresql-9.5 

然后重启 PostgreSQL,迁移数据库的新版本:

service postgresql start

关于postgresql - 我如何在 ubuntu 16.04 上将我的 Postgresql 9.5 升级到 Postgresql 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47029055/

相关文章:

ruby-on-rails - 使用 pluck 对关联表 ruby​​ 按计数排序

Java-错误 : Could not find or load main class

c - Valgrind 看不到 -g 文件中的行

postgresql - postgres中的多维距离

带有 GET STACKED DIAGNOSTICS 的 PostgreSQL 异常处理细节

postgresql - 在 Windows 7 上的 PostgreSql 10 中执行命令后, "*#"意味着什么?

ruby-on-rails - 唯一索引和标准索引是分开做的吗?

intellij-idea - intellij 导航回快捷方式不起作用

google-compute-engine - 错误 : Unauthorized on my own Google Cloud notebook

python - 在 Ubuntu 上使用 Python Selenium 上传文件