Any chance to upgrade the postgres-client version?

We are using Discourse with an external database instead of the integrated, Docker-based Postgres. We recently had to upgrade our Postgres cluster to 14, thus the Discourse backup keeps failing.

Log output

[2022-01-17 03:38:08] Dumping the public schema of the database...
[2022-01-17 03:38:08] pg_dump: error: server version: 14.1 (Ubuntu 14.1-1.pgdg18.04+1); pg_dump version: 13.5 (Debian 13.5-1.pgdg100+1)
[2022-01-17 03:38:08] pg_dump: error: aborting because of server version mismatch
[2022-01-17 03:38:08] EXCEPTION: pg_dump failed

Is there any way to upgrade the postgresql-client 13.5-1.pgdg100+1 of the container to version 14?

1 Like

We upgrade Postgres versions every two releases, because it takes a tremendous amount of engineering resources to upgrade the database. We are currently on Postgres 13 so we’ll upgrade to Postgres 15.1 when that is released (the bugfix point release).

1 Like

I do understand, but thanks for pointing out the upgrade policy - really good to know. We are aware of engineering resources regarding the DB. I love Postgres, but upgrading our cluster usually turns us to be devout Catholics - many prayers beforehand, but still a lot of blood, sweat and tears.

2 Likes

You should be able to manually install the required postgresql-client by adding the appropriate apt-get commands to your app.yml.

3 Likes

Would this cause any depency issues with Ruby gems of the application itself? As far as I understand adding apt install as a hook requires a launcher rebuild app, right? If so, I would skip this for another dreaded upgrade as described here in another topic of mine , we face massive problems of rebuilding the app inside China. That’s the reason why I would like to clarify if just entering the app and then manually installing it via apt would do the trick.

3 Likes

I suggest you test it on a staging site before doing anything in production, but I think there won’t be any issues with Ruby gems. Installing it in the running container should work as well.

2 Likes

So you will create the script next year in 2023 ? PostgreSQL: Versioning Policy

Should I open a new ticket for Backup failure ?

??? it takes a tremendous amount of engineering resources ???
It seems that these simple lines of commands to update the postgresql database from 13.5 to 14.1 solve the backup problem… Cheers

cd /var/discourse
./launcher enter app
sudo apt-get install postgresql

to officially support it, yes.

4 Likes