language: c
sudo: required
dist: trusty
compiler:
  - gcc
# - clang
env:
  - PGVERSION1=10
  - PGVERSION2=10

addons:
  apt:
    packages:
      - libperl-dev

# install PostgreSQL
# if PGVERSION1 != PGVERSION2, install both versions
before_install:
  - curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  - echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee -a /etc/apt/sources.list
  - sudo apt-get update -qq
  - sudo apt-get install postgresql-$PGVERSION1 postgresql-server-dev-$PGVERSION1 postgresql-client-$PGVERSION1 postgresql-plperl-$PGVERSION1 -y
  - sudo apt-get install postgresql-$PGVERSION2 postgresql-server-dev-$PGVERSION2 postgresql-client-$PGVERSION2 postgresql-plperl-$PGVERSION2 -y

# install pgquarrel
install:
  - test/travis/install-pgquarrel.sh $PGVERSION1 $PGVERSION2

# create test databases
before_script:
  - test/travis/setup-pg.sh $PGVERSION1 $PGVERSION2

script:
  - test/travis/run-tests.sh $PGVERSION1 $PGVERSION2

language: c
sudo: required
dist: trusty
compiler:
  - gcc
# - clang
env:
  - PGVERSION1=10
  - PGVERSION2=10

addons:
  apt:
    packages:
      - libperl-dev

# install PostgreSQL
# if PGVERSION1 != PGVERSION2, install both versions
before_install:
  - curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  - echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee -a /etc/apt/sources.list
  - sudo apt-get update -qq
  - sudo dpkg -l | grep postgres
  - sudo apt-get purge postgresql-9.2 postgresql-server-dev-9.2 postgresql-client-9.2 postgresql-plperl-9.2 -y
  - sudo apt-get install postgresql-$PGVERSION1 postgresql-server-dev-$PGVERSION1 postgresql-client-$PGVERSION1 postgresql-plperl-$PGVERSION1 -y
  - sudo apt-get install postgresql-$PGVERSION2 postgresql-server-dev-$PGVERSION2 postgresql-client-$PGVERSION2 postgresql-plperl-$PGVERSION2 -y

# install pgquarrel
install:
  - test/travis/install-pgquarrel.sh $PGVERSION1 $PGVERSION2

# create test databases
before_script:
  - test/travis/setup-pg.sh $PGVERSION1 $PGVERSION2

script:
  - test/travis/run-tests.sh $PGVERSION1 $PGVERSION2

Remove old PostgreSQL version installed by default
Remove old PostgreSQL version installed by default
