Postgres

Run multiple PostgreSQL instances on one machine

I’m on Ubuntu 18.04 having PostgreSQL 10.10 installed. For testing I had to run PostgreSQL 9.5 along with 10.10.

Installation

If you don’t know how to install version 9 on Ubuntu 18.04 check this doc on postgres site.

To install version 9.5 just run:

sudo apt install postgresql-9.5

That’s it. You should not face any other issues.

Usage

I’ve been always starting postgres instance with sudo service postgresql start but now, when we have two different version we should use: