Django - correct postgresql version in travis build

The build fails on db related errors that seems to be linked to the wrong postgres version being used. However, following Travis doc to set Postgres’ version does not seem to work as expected.

Here’s my .travis.yml file:

before_script:
  - psql --version
  - psql -c 'SELECT version();' -U postgres
  - psql -c "CREATE USER test WITH CREATEDB PASSWORD 'test;" -U postgres
script:
 - make checkstyle
 - make test

I get

$ psql --version
psql (PostgreSQL) 9.6.6

$ psql -c 'SELECT version();' -U postgres
                                                   version                                                    
--------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.2.24 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit
(1 row)

anyway of fixing this?

So, addons should be a map/dict/hash instead of an array/sequence. Try:

addons:
  postgresql: "9.6
1 Like