By Mouhamadou Diaw

As you may know PostgreSQL 9.6 was released a few months ago. And EnterpriseDB (EDB) offers a package installer for installing the community version. This EDB package can be downloaded here.
In this blog we are going to install PostgreSQL using edb installer. The installation is done using a graphical tool. A user with root privileges must be used otherwise we will get an error. Indeed the default installation creates the systemd service which need root privileges. For example using the user postgres for installation

[postgres@pgserver1 96]$ chmod +x postgresql-9.6.1-1-linux-x64.run
[postgres@pgserver1 96]$


[postgres@pgserver1 96]$ ./postgresql-9.6.1-1-linux-x64.run

install1
An alternative is to launch the installer with the option “–extract-only” which does not require root (but then we do not get the service)

Now logged as root, let’s start

[root@pgserver1 96]# ./postgresql-9.6.1-1-linux-x64.run

install2
Click on Next
install3
Specify PGHOME
install4
Specify the PGDATA
install5
Specify the password for user postgres
install6
The default port is 5432
install7
Choose your Locale
install8
And launch installation process
install9
install10
Once installation done we can verify that PostgreSQL is running

[postgres@pgserver1 ~]$ ps -ef | grep postgres
root 3135 976 0 09:53 ? 00:00:00 sshd: postgres [priv]
postgres 3140 3135 0 09:54 ? 00:00:00 sshd: postgres@pts/0
postgres 3142 3140 0 09:54 pts/0 00:00:00 -bash
root 3657 976 0 09:55 ? 00:00:00 sshd: postgres [priv]
postgres 3661 3657 0 09:55 ? 00:00:00 sshd: postgres@pts/2
postgres 3664 3661 0 09:55 pts/2 00:00:00 -bash
postgres 6255 1 0 10:23 ? 00:00:00 /u01/app/PostgreSQL/9.6/bin/postgres -D /u01/app/PostgreSQL/9.6/data
postgres 6256 6255 0 10:23 ? 00:00:00 postgres: logger process
postgres 6258 6255 0 10:23 ? 00:00:00 postgres: checkpointer process
postgres 6259 6255 0 10:23 ? 00:00:00 postgres: writer process
postgres 6260 6255 0 10:23 ? 00:00:00 postgres: wal writer process
postgres 6261 6255 0 10:23 ? 00:00:00 postgres: autovacuum launcher process
postgres 6262 6255 0 10:23 ? 00:00:00 postgres: stats collector process
postgres 6332 3664 0 10:26 pts/2 00:00:00 ps -ef
postgres 6333 3664 0 10:26 pts/2 00:00:00 grep --color=auto postgres
[postgres@pgserver1 ~]$

A file pg_env.sh is created during installation and can be used to setup all variables we need for the connection

[postgres@pgserver1 9.6]$ pwd
/u01/app/PostgreSQL/9.6
[postgres@pgserver1 9.6]$ cp pg_env.sh /home/postgres/
[postgres@pgserver1 9.6]$ cd
[postgres@pgserver1 ~]$


[postgres@pgserver1 ~]$ chmod +x pg_env.sh
[postgres@pgserver1 ~]$ . ./pg_env.sh
[postgres@pgserver1 ~]$ env | grep PG
PGPORT=5432
PGUSER=postgres
PGDATABASE=postgres
PGLOCALEDIR=/u01/app/PostgreSQL/9.6/share/locale
PGDATA=/u01/app/PostgreSQL/9.6/data
[postgres@pgserver1 ~]$

And now we can connect

[postgres@pgserver1 ~]$ psql
Password:
psql.bin (9.6.1)
Type "help" for help.


postgres=#

We can see that installation of PostgreSQL edb 9.6 is very easy.