Supported postgresql versions

Is there somewhere a note, which postgresql db versions are supported?

Would be great to have something for each released discourse version - especially if a postgresql version is no longer supported.

Postgres is bundled in with the Docker container for Discourse, so this is generally hands-off. The Discourse team upgrades the Postgres version as new releases come out and they are properly tested. The most recent upgrade was to version 13. You can see the details of that upgrade here:

3 Likes

Well, not everyone is using the bundled postgres db.

The current install doc lists Postgres 10+ as the required version:

https://github.com/discourse/discourse/blob/master/docs/INSTALL.md

That said, the only officially supported setups are using Docker containers.

2 Likes

Yes, the versions of postgres which are “supported” (from a docker build perspective, not all “strongly supported”) are listed in the templates directory of discourse_docker

Having said that, it is highly recommended to move to the latest version of postgres, currently version 13, as soon as you can.

However, if you are running Discourse on a host where you cannot run the latest version because of some local constraint in your organization; the discourse_docker templates directory is a good place to research.

4 Likes

Checking in three years later: The docker template still says PG_MAJOR=13, but there are new versions of PostgreSQL: 14 from 2021, 15 from 2022, and 16 from 2023.

So the recommendation is still to use version 13 (which will EOL in 2025) rather than the latest PostgreSQL 16 (which will EOL in 2028)?

Yes, exactly.

We have some sites running version 15 already, and should get to updating from 13 next year.

1 Like

Question: what is the current status here? I am running an external pg database and would like to upgrade the database server from 13. postgres 16 was released 2023-09-14. Can it be used with discourse? Will there be any migration steps required for the database itself? (aside from the global migration steps on the server side)

PostgreSQL 13 is still the officially supported version, with version 13.15 being released last month and still supported.

We have a good number of sites running version 15, and that is a known working version that we plan on shipping an update for self-hosted users eventually.

Version 16 is not widely tested outside of developer machines, but if you are feeling adventurous and want to give it a try and see if something breaks, let us know how it goes!

1 Like

Does Discourse do anything out of the ordinary with Postgres which would imply that upgrades to new versions of Postgres might not work with a simple dump and restore?

Bumping up this thread to see if there is a reason to try to upgrade to PostgreSQL 15 instead of 16 or 17?

And when should we expect to upgrade the PostgreSQL