Hi. I’m trying to install Postgres 11 with Postgis using the instructions from https://docs.travis-ci.com/user/database-setup/#using-a-different-postgresql-version.
Relevant snippet from my .travis.yml file:
But I keep getting this error:
$ psql -U postgres -c "CREATE EXTENSION postgis"
psql: FATAL: Peer authentication failed for user "postgres"
The command "psql -U postgres -c "CREATE EXTENSION postgis"" failed and exited with 2 during .
Any help is much appreciated.
This custom 
.travis.yml file should be helpful for what you need.
Travis CI Staff
 Travis CI - Test and Deploy with Confidence
@mustafaergul Thanks for reaching out and sorry about the late reply. I got distracted.
So I tried the custom .travis.yml that you linked to but I get an auth error now:
could not connect to postgres: error: password authentication failed for user “travis”
A Postgres restart fixed it, for those interested.
So my working
before_install looks like this:
- sudo sed -i -e "/local.*peer/s/postgres/all/" -e "s/peer\|md5/trust/g" /etc/postgresql/*/main/pg_hba.conf
- postgres --version
- sudo pg_ctlcluster 11 main restart