# PostGreSQL with PostGIS

**URL:** <https://travis-ci.community/t/postgresql-with-postgis/3627>\
**Category:** Linux\
**Created:** [June 4, 2019, 5:26pm UTC](https://travis-ci.community/t/postgresql-with-postgis/3627 "2019-06-04T17:26:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlaura](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jlaura](https://travis-ci.community/u/jlaura)\
**Post date:** [June 4, 2019, 5:26pm UTC](https://travis-ci.community/t/postgresql-with-postgis/3627/1 "2019-06-04T17:26:37Z")

</div>

I am having difficulty getting PostGreSQL with PostGIS working in a linux container. I am following the [docs](https://docs.travis-ci.com/user/database-setup/#postgresql) and have a travis.yml that contains the following:

```auto
language: generic
sudo: true

branches:
  only:
    - dev
    - testing

matrix:
  include:
    - os: linux
      dist: trusty
      env: PYTHON_VERSION=3.6
    - os: linux
      dist: trusty
      env: PYTHON_VERSION=3.7
    

# Setup a postgresql instance w/postgis
services:
  - postgresql
addons:
  postgresql: 9.6
  apt:
    packages:
    - postgresql-9.6-postgis-2.3

before_script:
  - psql -c 'create database travis_ci_test;' -U postgres
  - psql -U postgres -c "create extension postgis"

```

It appears that postgresql is starting as expected:

```bash
2.87s$ travis_setup_postgresql 9.6
Starting PostgreSQL v9.6
sudo service postgresql start 9.6

```

I am getting the following error during the build and I am not sure how to debug further:

```bash
0.01s$ psql -c 'create database travis_ci_test;' -U postgres
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The command "psql -c 'create database travis_ci_test;' -U postgres" failed and exited with 2 during .

```

Here is a [link to the build](https://travis-ci.org/USGS-Astrogeology/autocnet/jobs/541344337).

Any insight on how to continue to debug this would be appreciated.
