language: node_js
dist: bionic

before_script:
  - node packages/pg/script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres

env:
  - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres

node_js:
  - lts/dubnium
  - lts/erbium
  - 13

addons:
  postgresql: "10"

matrix:
  include:
    - node_js: lts/carbon
      addons:
        postgresql: "9.5"
      dist: precise

    # different PostgreSQL versions on Node LTS
    - node_js: lts/erbium
      addons:
        postgresql: "9.3"
    - node_js: lts/erbium
      addons:
        postgresql: "9.4"
    - node_js: lts/erbium
      addons:
        postgresql: "9.5"
    - node_js: lts/erbium
      addons:
        postgresql: "9.6"

    # PostgreSQL 9.1 and 9.2 only work on precise
    - node_js: lts/carbon
      addons:
        postgresql: "9.1"
      dist: precise
    - node_js: lts/carbon
      addons:
        postgresql: "9.2"
      dist: precise

language: node_js
dist: bionic

before_script:
  - node packages/pg/script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres

env:
  - CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres

node_js:
  - lts/dubnium
  - lts/erbium
  - 13

addons:
  postgresql: "10"

matrix:
  include:
    - node_js: lts/carbon
      addons:
        postgresql: "9.5"
      dist: precise

    # different PostgreSQL versions on Node LTS
    - node_js: lts/erbium
      addons:
        postgresql: "9.3"
    - node_js: lts/erbium
      addons:
        postgresql: "9.4"
    - node_js: lts/erbium
      addons:
        postgresql: "9.5"
    - node_js: lts/erbium
      addons:
        postgresql: "9.6"

    # PostgreSQL 9.2 only works on precise
    - node_js: lts/carbon
      addons:
        postgresql: "9.2"
      dist: precise

Remove postgres 9.1 from test matrix - json is not supported
Remove postgres 9.1 from test matrix - json is not supported
