Skip to content
Odotify

Odoo PostgreSQL version: which one each Odoo release needs

Odotify team · Published · 7 min read

A table matching Odoo 17, 18, 19 and 20 with their minimum PostgreSQL versions

This guide answers one question that trips up many Odoo upgrades: which PostgreSQL version does my Odoo version need, and what do I do if my server has the wrong one? It is for admins and partners who install, move or upgrade Odoo on their own servers. By the end you will know the minimum PostgreSQL for Odoo 17 to 20, which version your Linux distribution installs, which PostgreSQL majors are still supported, and how to upgrade PostgreSQL without losing data. Facts come from Odoo's installation documentation, the Odoo source code, postgresql.org and the Ubuntu and Debian package archives, all checked on 24 November 2026.

Which PostgreSQL version does Odoo need?

The minimum rose from PostgreSQL 12 to 13 in Odoo 19, and to 16 in Odoo 20. Odoo's source installation guide for each version lists the supported PostgreSQL, and since Odoo 19 the source code also carries a MIN_PG_VERSION constant in odoo/release.py.

Odoo versionReleasedStandard support endsMinimum PostgreSQLMinimum Python
Odoo 17.0November 2023September 2026123.10
Odoo 18.0October 2024September 2027 (planned)123.10
Odoo 19.0September 2025September 2028 (planned)133.10
Odoo 20.0September 2026September 2029 (planned)163.12

The Odoo 20.0 documentation states it directly: "Minimum requirement updated from PostgreSQL 13 to PostgreSQL 16." Odoo does not publish a maximum PostgreSQL version. In practice, use a PostgreSQL major that is both above Odoo's minimum and still supported by the PostgreSQL project, and test a newer major on a staging copy before production.

What happens if PostgreSQL is too old?

In the Odoo 19.0 and 20.0 source code, when Odoo opens a database connection it compares the server version with MIN_PG_VERSION and emits a warning ("Postgres version is …, lower than minimum required …"). It does not refuse to connect. That makes the problem easy to miss: the server starts, and then something fails later, during module installation, an upgrade script or a query that uses a newer PostgreSQL feature. Treat that warning as an error.

Which PostgreSQL does my Linux distribution ship?

Ubuntu 24.04 ships PostgreSQL 16, Debian 13 ships 17, and Ubuntu 26.04 ships 18. The postgresql package in each release's archive, checked on packages.ubuntu.com and packages.debian.org:

DistributionDefault PostgreSQLOdoo 17 / 18Odoo 19Odoo 20
Ubuntu 22.04 (jammy)14YesYesNo
Debian 12 (bookworm)15YesYesNo
Ubuntu 24.04 (noble)16YesYesYes
Debian 13 (trixie)17YesYesYes
Ubuntu 26.04 (resolute)18YesYesYes

"Yes" means the default package meets Odoo's minimum. The two traps are Ubuntu 22.04 and Debian 12: both run Odoo 19 fine but are too old for Odoo 20 without a newer PostgreSQL. You can get one from the PostgreSQL project's own apt repository, which postgresql.org says carries all supported PostgreSQL versions for Ubuntu 22.04, 24.04, 26.04 and 26.10:

sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt install -y postgresql-16

On a new server, the simpler route is to pick Ubuntu 24.04 or newer, or Debian 13, and use the distribution's PostgreSQL. Our Odoo server requirements guide covers CPU, RAM and disk for the same servers.

Which PostgreSQL versions are still supported?

PostgreSQL 15 to 19 are supported; 14 reached end of life on 12 November 2026. The PostgreSQL project supports each major version for five years and releases minor versions with bug and security fixes at least every three months. From postgresql.org's versioning page:

PostgreSQLFirst releaseFinal release (end of support)Supported
1919 November 202619 November 2031Yes
1825 September 202514 November 2030Yes
1726 September 20248 November 2029Yes
1614 September 20239 November 2028Yes
1513 October 202211 November 2027Yes
1430 September 202112 November 2026No
1324 September 202013 November 2025No
123 October 201921 November 2024No

Two answers follow. PostgreSQL 13 and 14 are no longer supported, so an Odoo 17 or 18 server still on Ubuntu 22.04's PostgreSQL 14 now runs a database engine without security fixes. And PostgreSQL 17 is a mature, supported release: it has been out since September 2024 and has had twelve minor releases (17.12 is current).

Which one to pick for Odoo in late 2026? PostgreSQL 16 or 17 for most installs: both meet Odoo 20's minimum, both are the defaults on current LTS distributions, and both are supported until 2028 and 2029. PostgreSQL 18 is fine where your distribution ships it. PostgreSQL 19 came out five days before this article; wait for a few minor releases and test it on staging first.

How to check your PostgreSQL version

On the server, the client and server versions:

psql --version
sudo -u postgres psql -c "SHOW server_version;"

From inside a database (for example with psql -d yourdb):

SELECT version();

On Debian and Ubuntu, pg_lsclusters lists every cluster with its version, port and status, which matters when an old and a new version are installed side by side.

How to upgrade PostgreSQL for Odoo

Upgrade PostgreSQL first, as its own step, then upgrade Odoo. Mixing the two makes it hard to tell which change broke something. There are two safe methods.

Option 1: pg_upgradecluster on Debian and Ubuntu

The postgresql-common package ships pg_upgradecluster, which upgrades a whole cluster to a new major version. Its manual says it uses pg_dump by default ("slow, but safe"), copies and adjusts the configuration, moves the old cluster to an unused port and does not delete it.

sudo systemctl stop odoo
sudo apt install -y postgresql-16          # the new major
sudo pg_lsclusters                         # e.g. 14 main online
sudo pg_upgradecluster 14 main             # creates 16 main on port 5432
sudo pg_lsclusters                         # check 16 main is online
sudo systemctl start odoo

After a few days of normal use, remove the old cluster with sudo pg_dropcluster 14 main. The faster --method=upgrade uses pg_upgrade under the hood; the manual warns to take care with it during an operating system upgrade, because a new libc or ICU can change collation order and require index rebuilds.

Option 2: dump and restore

Works everywhere, including when moving to a new server, which is often the cleaner path:

pg_dump -Fc -d production -f production.dump        # on the old server
createdb -O odoo production                          # on the new server
pg_restore -d production --no-owner --role=odoo production.dump

Copy the filestore (~/.local/share/Odoo/filestore/production or the data_dir set in odoo.conf) along with the dump. Our Odoo backup and restore guide has the full commands.

pg_upgrade on other systems

pg_upgrade from PostgreSQL itself upgrades data files to a later major version without a full dump and restore. Its documentation notes it is not needed for minor updates, such as 16.4 to 16.16, which your package manager installs in place.

Steps to move an Odoo server to a newer PostgreSQL

  1. Check the Odoo version you run or plan to run and its minimum PostgreSQL from the table above.
  2. Take a full backup: database dump plus filestore, copied off the server.
  3. Restore that backup on a staging server with the new PostgreSQL and run Odoo against it.
  4. Click through your main flows, run scheduled actions and watch the log for warnings.
  5. Schedule a short maintenance window, stop Odoo, and upgrade the production cluster with pg_upgradecluster or dump and restore.
  6. Start Odoo, check SELECT version(); and the log, and keep the old cluster until you are sure.
  7. Only then start the Odoo version upgrade; our Odoo upgrade guide covers that part.

How Odotify handles PostgreSQL versions

Odotify is our product. It runs Odoo 17 to 20 on your own server and reads the PostgreSQL version each server reports. It refuses to create an Odoo 20 instance, or start an upgrade to Odoo 20, on a server or database cluster with PostgreSQL older than 16, and tells you to pick a server on Ubuntu 24.04 or newer or Debian 13. Upgrades run on a staging copy first. Plans start at $0 a month; see pricing, or read about Odoo 20 hosting.

FAQ

What PostgreSQL version does Odoo 20 need?

PostgreSQL 16 or newer. Odoo's 20.0 installation guide raised the minimum from 13 to 16, and MIN_PG_VERSION = 16 in the 20.0 source code.

What PostgreSQL version does Odoo 19 need?

PostgreSQL 13 or newer. Since PostgreSQL 13 and 14 are out of support, use 15, 16 or 17 for a new Odoo 19 server.

What PostgreSQL version does Odoo 17 or 18 need?

PostgreSQL 12 or newer, per the 17.0 and 18.0 installation guides. Prefer a supported version, 15 or newer.

Is PostgreSQL 14 still supported?

No. PostgreSQL 14 reached its final release on 12 November 2026. PostgreSQL 13 ended on 13 November 2025.

Can I upgrade PostgreSQL and Odoo at the same time?

You can, but it is safer not to. Upgrade PostgreSQL first and run Odoo on it for a while, then upgrade Odoo. If something breaks, you will know which change caused it.

Does Ubuntu 22.04 work for Odoo 20?

Not with its default PostgreSQL 14. Install PostgreSQL 16 or newer from the PostgreSQL apt repository, or use Ubuntu 24.04 or Debian 13 instead.

Sources

Odotify team

Odotify hosts Odoo on servers its customers own. This article was researched against live search results and the Odotify codebase.

More articles

All articles

Run Odoo on your own server, without the server work.

Odotify installs, backs up, updates and watches Odoo on any Linux server you own. Free for one server.