Install latest Postgres client version besides the one for PG_MAJOR (#729)
authorLeonardo Mosquera <ldmosquera@gmail.com>
Fri, 25 Aug 2023 18:30:28 +0000 (15:30 -0300)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2023 18:30:28 +0000 (15:30 -0300)
commitbc1383a622105dd17463164f5aa83e985911a7e6
treeb4ba97ff837351ec1f6b88b538518b50d683efb0
parent97ebba29029ca3147f152451785dcb10490c5cfa
Install latest Postgres client version besides the one for PG_MAJOR (#729)

Before, if a remote server is upgraded to a newer PG version, it wouldn't be able to be backed up from inside the application, since `pg_dump` would be a lower version, resulting in this:

```
pg_dump: error: server version: 15.3; pg_dump version: 13.11 (Debian 13.11-1.pgdg110+1)
pg_dump: error: aborting because of server version mismatch
```

With this change, `postgresql-${PG_MAJOR}` pulls in `postgresql-client` for the server version, AND `postgresql-client` metapackage pulls in the latest version available in the upstream Apt repository.

This guarantees there will be a `pg_dump` for the latest version available, so a remote server freshly upgraded to that latest version will always be able to be backed up from inside the application (since [`pg_wrapper`](https://github.com/credativ/postgresql-common/blob/master/pg_wrapper#L110) chooses the latest locally available version for remote connections).

* Bump Postgres client version ahead of Postgres server version bump
* Fall back to PG_MAJOR if client env var is undefined
* Use postgresql-client metapackage instead for latest client version
image/base/slim.Dockerfile