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 はデフォルトで Postgres 11 を提供しています。バージョン 10 は「ベータ」としてのみ利用可能です。

11.x へのサポートはいつ提供される見込みですか?

数ヶ月以内に 12.x への移行を予定しています。11.x はスキップされます。

Postgres 11 へのデプロイは既に完了しています。
引き続き利用することは可能でしょうか?
動作しないのはバックアップ機能だけでしょうか?
エクスポート/インポートが不可能な場合、10 へダウングレードするにはどうすればよいでしょうか?

PostgreSQLは機能の動作維持に非常に堅牢で、機能を安易に削除しないため、コンテナ内の pg_dump のバージョンに依存するバックアップとリストアを除き、動作するはずです。

当社はこれを実行せず、テストも行っていないため、問題が発生した場合は自己責任となります。

私どもも同じ状況でした。ドキュメント で Postgres 10 以上が必要とされていたため、GCP 管理型 Postgres 11 をデプロイしていました。

最終的には、ブートストラップにカスタムコマンドを追加して 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 にて PostgreSQL 12 の更新が公開されました。これは AWS RDS で利用可能です。