# Any chance to upgrade the postgres-client version?

**URL:** https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063
**Category:** Self-hosting
**Created:** [January 17, 2022, 9:03am UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063 "2022-01-17T09:03:37Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![leoniscsem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leoniscsem/32/116762_2.png) [@leoniscsem](https://meta.discourse.org/u/leoniscsem)
#### Post date: [January 17, 2022, 9:03am UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/1 "2022-01-17T09:03:37Z")

</div>

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**

```ruby
[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?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 17, 2022, 6:18pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/2 "2022-01-17T18:18:26Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![leoniscsem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leoniscsem/32/116762_2.png) [@leoniscsem](https://meta.discourse.org/u/leoniscsem)
#### Post date: [January 17, 2022, 6:48pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/3 "2022-01-17T18:48:36Z")

</div>

> [@codinghorror](#):
>
> it takes a tremendous amount of engineering resources to upgrade the database

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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [January 17, 2022, 7:09pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/4 "2022-01-17T19:09:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![leoniscsem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leoniscsem/32/116762_2.png) [@leoniscsem](https://meta.discourse.org/u/leoniscsem)
#### Post date: [January 17, 2022, 7:29pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/5 "2022-01-17T19:29:00Z")

</div>

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](https://meta.discourse.org/t/bootstrap-rebuild-without-cloning-everything-over-again/214354/) , 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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [January 17, 2022, 7:33pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/6 "2022-01-17T19:33:17Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Donavan\_Martin1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donavan_martin1/32/243280_2.png) [@Donavan\_Martin1](https://meta.discourse.org/u/Donavan_Martin1)
#### Post date: [February 1, 2022, 12:00am UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/7 "2022-02-01T00:00:26Z")

</div>

So you will create the script next year in 2023 ? [PostgreSQL: Versioning Policy](https://www.postgresql.org/support/versioning/)

---

<div class="post-metadata">

### Author: ![Donavan\_Martin1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donavan_martin1/32/243280_2.png) [@Donavan\_Martin1](https://meta.discourse.org/u/Donavan_Martin1)
#### Post date: [February 2, 2022, 2:18am UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/8 "2022-02-02T02:18:14Z")

</div>

Should I open a new ticket for Backup failure ?

---

<div class="post-metadata">

### Author: ![Donavan\_Martin1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/donavan_martin1/32/243280_2.png) [@Donavan\_Martin1](https://meta.discourse.org/u/Donavan_Martin1)
#### Post date: [February 5, 2022, 2:15pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/9 "2022-02-05T14:15:11Z")

</div>

??? 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

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [February 5, 2022, 6:00pm UTC](https://meta.discourse.org/t/any-chance-to-upgrade-the-postgres-client-version/215063/10 "2022-02-05T18:00:56Z")

</div>

> [@Donavan\_Martin1](#):
>
> it takes a tremendous amount of engineering resources

to _officially support it_, yes.
