Install Postgresql 11

For what it is worth, I needed to do the following to my .travis.yml to get PostgreSQL 11 + Postgis 2.5 working.

  • drop the usage of service: and addons: to install/start postgres
  • use dist: xenial

and then for my before_install:

  - sudo service postgresql stop
  - sudo apt-get --yes remove postgresql-10-postgis-2.4
  - sudo apt install -yq --no-install-suggests --no-install-recommends postgresql-11-postgis-2.5-scripts postgresql-11 postgresql-client-11 postgresql-11-postgis-2.5
  - sed -e 's/^port.*/port = 5432/' /etc/postgresql/11/main/postgresql.conf > postgresql.conf
  - sudo chown postgres postgresql.conf
  - sudo mv postgresql.conf /etc/postgresql/11/main
  - sudo cp /etc/postgresql/{10,11}/main/pg_hba.conf
  - sudo service postgresql restart 11

and then for my before_script:

  - export PATH="/usr/lib/postgresql/11/bin:$PATH"
  - psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;' -U postgres

YMMV