Skip to content

Running multiple PostgreSQL versions in parallel on RHEL 7

Given that we can install PostgreSQL 9.3 and 9.4 (more to come) on RHEL 7, the next step will be running them in parallel.

Before you start, please make sure that you followed each step in the previous post.

Since we removed PGPORT variable in unit files (YAY!), the only thing that you should change is the port (unless you want to bind these instances to separate IP addresses...). Let's do it in a scripted way:

sed -i "s/#port = 5432/port = 5432/g" /var/lib/pgsql/9.3/data/postgresql.conf

sed -i "s/#port = 5432/port = 5433/g" /var/lib/pgsql/9.4/data/postgresql.conf

Great. Now 9.3 instances will use 5432, and 9.4 will use 5433. You can change them as you wish.

Finally, please start both instances:

systemctl start postgresql-9.3.service

systemctl start postgresql-9.4.service

You can verify this by connecting to instances using psql:

psql -p 5432 <-- will connect to 9.3 instance
psql -p 5433 <--- will connect to 9.4 instance.



No Trackbacks


Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Form options