由于 AWS 版本不匹配,无法进行备份

Hi, I’m configuring an environment that is pointed at an external AWS rds instance (postgres 11.x)

I notice this error when trying to backup through the UI:

[2019-10-25 21:50:35] Dumping the public schema of the database...
[2019-10-25 21:50:35] pg_dump: server version: 11.5; pg_dump version: 10.10 (Debian 10.10-1.pgdg100+1)
[2019-10-25 21:50:35] pg_dump: aborting because of server version mismatch

I guess this is because the docker container’s pg_dump version is not matching the version of the external rds database. Any suggestions on how to deal with this? Should I just use an external db that isn’t 11.x?

The supported PostgreSQL version currently is 10.x. We plan on upgrading to 12.x in the next release cycle.

Google Cloud Platform 默认提供 PostgreSQL 11。版本 10 仅作为“测试版”提供。

我们何时能期待对 11.x 的支持?

我们计划在几个月内升级到 12.x 版本。11.x 版本将被跳过。

我们已经部署了 PostgreSQL 11。
可以继续使用该版本吗?
是否只有备份功能无法使用?
如果无法通过导出/导入的方式,该如何降级到 10?

由于 PostgreSQL 在保持功能正常运行方面非常稳健,不会轻易移除功能,因此应该可以正常工作,但备份和恢复功能除外,这取决于容器内 pg_dump 的版本。

我们不运行它,也不对其进行测试,因此如果出现任何问题,需自行解决。

我们当时处境相同:部署在 GCP 托管的 Postgres 11 上,因为 文档 要求 Postgres 10 及以上版本。

我们最终在引导脚本中添加了一个自定义命令,安装 PG 11 客户端工具,并将 pg_dump 默认切换为该版本。

  - exec:
      cmd:
        - apt-get update && apt-get install postgresql-client-11 && update-alternatives --install /usr/bin/pg_dump pg_dump /usr/lib/postgresql/11/bin/pg_dump 1

这是一个合理的变通方案,我们计划在未来几个月内将官方镜像中的 PostgreSQL 升级到 12 版本。

我们现在运行 PostgreSQL 12 update AWS RDS 中可用。