Skip to content

Installing and running PostgreSQL 9.5 using RPMs on RHEL/CentOS/Scientific Linux/Oracle Linux and Fedora

PostgreSQL 9.5 was released recently. We released PostgreSQL 9.5 RPMs at the same day.

In this blog post, I am going to write you how to install PostgreSQL 9.5 on RHEL/CentOS/Scientific Linux/Oracle Linux 6 and 7 , Fedora 22 and 23.
First, as usual, you need to install the repository package. Please visit the repo RPMs page. You will see a link to the repo package links. Choose your distro/arch, and install the RPM to your server via your package manager.

Next step is installing PostgreSQL 9.5. You can either install the individual RPMs, or use groupinstall feature that install -libs, -server, -contrib along with the client package.

Please note that Fedora switched to dnf, so the commands will differ slightly:

On RHEL 6 and 7:

yum install postgresql95-server postgresql95-contrib


on Fedora:

dnf install postgresql95-server postgresql95-contrib


The next step is initializing the cluster. This step is different on RHEL 6, as compared to others. On RHEL 6, you can use the init script for initializing your cluster:

service postgresql-9.5 initdb


On RHEL 7 and Fedora, use the custom provided script, as systemd does not allow us to run initdb via unit file:

/usr/pgsql-9.5/bin/postgresql95-setup initdb


If there is no error message, you are ready to start the cluster.

Before starting, let's make sure that PostgreSQL will start on boot. On RHEL 6:

chkconfig postgresql-9.5 on


on RHEL 7 and Fedora:

systemctl enable postgresql-9.5.service


Now, let's start PostgreSQL 9.5. On RHEL 6, this This is done using the init script:

service postgresql-9.5 start


on RHEL 7 and Fedora:

systemctl start postgresql-9.5.service


The postmasters should start, if there is no port conflict, etc.

As of RHEL 7, as done in the Fedora packages for two years, the unit files are located under /lib/systemd/system/ directory. Please do not edit these files directly. Instead, if you want to make any changes, create a copy of them under /etc/systemd/system/ , and edit those files. Run
systemctl daemon-reload
after adding a custom unit file.

Please let us know if you see any packaging issues.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

Andrew Dunstan on :

You don't need to make a copy of the systemd file. Here's what I have in one instance:

$ cat /etc/systemd/system/postgresql-9.4.service
.include /lib/systemd/system/postgresql-9.4.service
[Service]
Environment=PGDATA=/db-data/data

Devrim Gündüz on :

Thanks Andrew.

Martina on :

Having said that, you can easily help this along by concentrating on developing your psychic ability exterior of readings.

Aleshia Scurci on :

And yet it seems to me that you need to think carefully about the answer ... Such questions cannot be solved in a rush!

Diego Mcvay on :

Lovely site! I am loving it!! Will be back later to read some more. I am taking your feeds also.

Sharmaine Meleski on :

Currently it appears like Wordpress is the preferred blogging platform out there right now. (from what I've read) Is that what you're using on your blog?

Sharen Rigney on :

Hi there, I found your website via Google while looking for a related topic, your web site came up, it looks great. I've bookmarked it in my google bookmarks.

Shakia Collicott on :

There are certainly a lot of details like that to take into consideration. That may be a great level to bring up. I provide the ideas above as basic inspiration however clearly there are questions like the one you convey up the place the most important factor can be working in honest good faith. I don?t know if finest practices have emerged round issues like that, however I'm positive that your job is clearly identified as a fair game. Both girls and boys really feel the influence of just a moment’s pleasure, for the remainder of their lives.

Madaline Belz on :

You are wrong. I propose to discuss it. Email me at PM, we'll talk.

William Cripps on :

Wow, wonderful blog format! How long have you been running a blog for? you make running a blog look easy. The full glance of your web site is excellent, as neatly as the content!

Clorinda Lagarde on :

I'm preparing to start my blog site quickly, however I'm a little lost on everything. Do you suggest starting with a cost-free system like WordPress or opt for a paid choice? There are many platforms around that I'm totally confused. Any kind of ideas? Thanks a great deal.

Jamey Hanson on :

I think we sell PostgreSQL short and create future problems for users by not including more of the ecosystem in a basic/default installation. For example, this process does not include postgresqlXX-docs, pgagent, barman, pgpool, pg_top, pl or PostGIS (which requires EPEL). I realize that all these tools (and many more!) are available to people who want them ... but please consider updating "default" instructions to include more of the PostgreSQL ecosystem.

It is challenging to work with clients who hear about great things PostgreSQL can do and always have to respond ... "Oh, you don't get that data-type/language/utility/etc. unless you do a special installation."

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.
CAPTCHA

Form options