Wednesday 23 August 2017

PostgreSQL Installation on Linux

The following must be done via root or sudo. Change any mention of <version> to the version of postgres being installed.
1-- Verify which OS release that is being used
cat /etc/redhat-release
uname -a

2-- Visit http://yum.postgresql.org/repopackages.php and select the correct repo RPM for your operating system to your server. Chose the latest stable postgres release - at the time of writing that is postgres 9.4

3-- Install the repo RPM using
rpm -ivh <package downloaded in the last step>

4-- Now install postgres using the yum package manager - follow any prompts the application might provide. E.g. for postgres 9.4:
yum install postgresql94*
Confirm installed RPM
Rpm -qa postgresql94*

5-- Initialize the cluster - replace version with the installed version
service postgresql-<version> initdb

6-- Start postgres
service postgresql-<version> start

7--If you wish for postgres to automatically enable it by chkconfig
chkconfig postgresql-<version> on

8--Add postgres to the system path

9--Switch to the postgres user
su - postgres

10--Connect to postgres using the psql client.
psql
psql (9.4.4)
Type "help" for help.

****************************************************************


No comments:

Post a Comment