8.0.1 minimum Postgres version requirements not met

I upgraded this morning from 7.9.1 to 8.0.1 and when I tried starting the mattermost service it failed to start with an error “minimum Postgres version requirements not met.”. I have postgres 12.15 installed on Ubuntu 20.04, this should meet the minimum requirements

@isacikgoz @agnivade Do you know what could be causing the error?

Hmm… we are just comparing the version with a basic integer. Something must be odd here, @petere can you share the output of SHOW server_version_num; query (you can run this query from pgcli)?

The output is


I’m confused now. Internal queries are returning version 10 but the psql tool reports version 12.
$ sudo -u postgres psql -c “SELECT version()”

PostgreSQL 10.23 (Ubuntu 10.23-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
(1 row)

$ sudo -u postgres psql -c “SHOW server_version”

10.23 (Ubuntu 10.23-0ubuntu0.18.04.1)
(1 row)

$ sudo -u postgres psql -V
psql (PostgreSQL) 12.15 (Ubuntu 12.15-0ubuntu0.20.04.1)

I have 10 and 12 installed

$ dpkg -l | grep postgresql
ii  postgresql                             12+214ubuntu0.1                   all          object-relational SQL database (supported version)
ii  postgresql-10                          10.23-0ubuntu0.18.04.1            amd64        object-relational SQL database, version 10 server
ii  postgresql-12                          12.15-0ubuntu0.20.04.1            amd64        object-relational SQL database, version 12 server
ii  postgresql-client-10                   10.23-0ubuntu0.18.04.1            amd64        front-end programs for PostgreSQL 10
ii  postgresql-client-12                   12.15-0ubuntu0.20.04.1            amd64        front-end programs for PostgreSQL 12
ii  postgresql-client-common               214ubuntu0.1                      all          manager for multiple PostgreSQL client versions
ii  postgresql-common                      214ubuntu0.1                      all          PostgreSQL database-cluster manager
ii  postgresql-contrib                     12+214ubuntu0.1                   all          additional facilities for PostgreSQL (supported version)

I followed the guide Upgrade PostgreSQL Version in Ubuntu 20.04 | by Moorthiyuvaraj | YavarTechWorks | Medium to upgrade postgresql and now when I run SHOW server_version_num I get:



I was able to upgrade to 8.0.1 now and it works!

1 Like

This is quite normal and can happen. The postgres server and the psql client can be on different versions.