Postgres 9.5.3 `pg_dump` version mismatch

Using the Ubuntu 14.04 (Trusty) environment you should be able to use Postgres 9.5.3 according to the docs:
https://circleci.com/docs/build-image-trusty/

When I print the versions of both psql and pg_dump I get the following version mismatch:

psql (PostgreSQL) 9.5.3
pg_dump (PostgreSQL) 9.4.8

Locally I get the same versions.

It seems that the pg_dump is not linked correctly.

Can be fixed by linking pg_dump to the 9.5.3 version:

ln -sfn /usr/lib/postgresql/9.5/bin/pg_dump /usr/bin/pg_dump

Maybe this is something that can be fixed in the environment by default?

Thanks

It’s a bit worse than that, both versions of the server and tools are running and coexist.

This is what I get with a default environment:

psql (9.5.3, server 9.4.8)

The matching 9.5.3 server is in fact running and listening on port 5433.

Yes, I found that as well. In the end I also had to add a couple of lines to kill the 9.4 server and to use 9.5.

From this post: Request: Postgres 9.5

So I ended up having

...
dependencies:
  ...
  machine:
    ...
    environment:
      ...
      DATABASE_URL: postgres://postgres@127.0.0.1:5433/circle_ruby_test
      ...
  override:
    - sudo service postgresql stop 9.4
    - sudo cp -v /etc/postgresql/9.{4,5}/main/pg_hba.conf && sudo service postgresql restart 9.5
    - sudo ln -sfn /usr/lib/postgresql/9.5/bin/pg_dump /usr/bin/pg_dump
    - bundle install
...

Dreadful IMHO, so I hope we will be able to specify a version for postgres in the config soon.

Thanks for reporting this. We’re aware of the issue and will release a fix, so that 9.5.3 server will be the default, with the next Trusty image update. I don’t have an exact ETA but it will be within the next week.

This is now fixed in the latest release of our 14.04 image. 9.5.3 is now the only version running (both server and client) by default.

If you need 9.4, please see this post: Request: Postgres 9.5