How to Install PostgreSQL Database Server 10.4 on Ubuntu 16.04

Posted on

This is an article made to show how to install PostgreSQL Database Server in Ubuntu Linux 16.04. The version of the database is the PostgreSQL Database Server 10.4. This article written contains several steps taken in order to install the PostgreSQL Database Server 10.4 with the compilation method executed from the downloaded source available. It can actually be done by several way which one f the other way is basically using package management tool instead of going through the compilation process. There is some advantages compared from the installation process using the compilation method instead of using the automatic command execution installation provided by the package management tool. Those advantages are enlisted below :

1. It can be considered as independent from the flavor or the type of Linux distribution used. The source which is being compiled knows no boundary of Linux operating system’s type.

2. It can add additional arguments needed in order to define additional features for PostgreSQL Database Server which is going to be installed.

3. The version of the installed PostgreSQL Database Server can be chosen freely. It knows no limitation because of the available version of the repository used when the package management tool is used to install PostgreSQL Database Server. As it can be figured out, the repository defined as the source of the package or application, the PostgreSQL Database Server version chosen is limited depends on whether it is available or not in the associated repository configured or installed in the operating system.

4. The compilation process can be done as many as it can be done in order to add another features available for PostgreSQL Database Server.

Before the installation steps can be taken, there are several prerequisites which is needed to be fulfilled. It is actually the availability of certain libraries named libreadline6-dev dan zlib1g-dev. It is needed in order for the compilation process can eventually succeed.

 

So, if the prerequisite has been fulfilled, below is the actual steps taken for further installation :

1. Download the PostgreSQL Database Server’s source to be compiled. The installation process executed in this article is using PostgreSQL Database Server 10.4 as the database which is chosen to be installed. The reason is because there are several interesting feature available in the version which one of it is Parallel Query. Used any search engine for an example Google to search the site containing source of the PostgreSQL Database Server with the strong keyword such as ‘postgresql-10.4.tar.bz2’. The following is the actual image presented after searching it with an actual searching processĀ  using Google search engine :

How to Install PostgreSQL Database Server 10.4 on Ubuntu 16.04
How to Install PostgreSQL Database Server 10.4 on Ubuntu 16.04

Click one of the list popped-up in the top of the page to access and download the source of PostgreSQL Database Server. Below is page of the link will look like :

How to Install PostgreSQL Database Server 10.4 on Ubuntu 16.04
How to Install PostgreSQL Database Server 10.4 on Ubuntu 16.04

Click the link to begin the download process of postgresql-10.4.tar.bz2.

2. After successfully downloading the file, just move the result of the downloading process in any folder chosen. Normally, as seen as it can be assumed as a standard convention, for the sake of the extraction process, it can be stored in the ‘/usr/src’. From the name of the path, ‘usr’ is destined for user’s necessity and the name of the folder following it, ‘src’ is considered to be the location to store source of any kinds of source files which is going to be further processed.

3. Execute the following command on the command-line interface to extract the already downloaded file :

tar -xvjf postgresql-10.4.tar.bz2

4. Execute the compilation process against the source file which has been successfully extracted with the following command :

./configure --prefix=/path/server/postgresql

*–prefix=/path/server/postgresql must be changed with any path or location desired to store the compiled PostgreSQL Database Server

5. After finishing the process above, just execute the following command :

make

6. Continue on to execute the command below :

make install

If the whole sequence of the above steps taken above are successfully carried out without any error generated, then basically the process of installing PostgreSQL Database Server 10.4 on Ubuntu Linux 16.04 through compilation process has finally succeeded.

One thought on “How to Install PostgreSQL Database Server 10.4 on Ubuntu 16.04

Leave a Reply