How to install PostgreSQL 9.4 on CentOS 7
In this, we will show you How to install PostgreSQL 9.4 on CentOS 7, RedHat. You will see how to Install PostgreSQL on CentOS is very easy and quick to install and use.
Before installing here is short description about PostgreSQL
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation.
Read Also: How to install postgresql 9.6 on CentOS 7
Add Repo
Firstly we need to add pgdg repository in CentOS 7
$ yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.9-x86_64/pgdg-centos94-9.4-3.noarch.rpm
Install Postgresql
In CentOS/Redhat/Fedora
$ yum -y groupinstall "PostgreSQL Database Server 9.4 PGDG"
Create a new PostgreSQL database cluster
$ /usr/pgsql-9.4/bin/postgresql94-setup initdb
Initializing database ... OK
Restart the services of postgresql
Now execute the following command to start and enable the postgresql services.
$ systemctl start postgresql-9.4
$ systemctl enable postgresql-9.4
PostgreSQL installation is done. If you want to use postgreSQL log in postgres account by typing following command
su - postgres
You can get postgres console by typing
psql
Now use the postgresql as you want to use. To get the help use \h command.
Read Also: Useful s3 commands
If you have any problem using this tutorial feel free to comment.
Was very useful. Thank you. Would be helpful if you share output screenshots too.