Install PostgreSQL from Source on RHEL/CentOS

隐身守侯 提交于 2020-02-29 15:36:32

PostgreSQL, as we know is an Open Source RDBMS. Since I am not that much into Database, I don’t know how it compares with MySQL.My focus on this post is on how to install it on a Linux server. Lets start with it

Download source-code. First step will be to download the source-code from its official site. Choose the version that you want to install. I chose 9.3.5 since this was my requirement. I downloaded the zipped tar file. Choose any one that suits you. Its around 21MB in size.

Unpack the tar file. Now we need to untar the downloaded file & configure it to prepare installation. Issue below command to untar it.

tar -xvf postgresql-9.3.5.tar.gz

Do a listing of the pwd (present working directory) & see if a new directory is created or not. Now move to this directory. By default, PostgreSQL is installed under /usr/local/pgsql directory. If you want to install it here, just run the configuration script, that is :

./configure

If you want it to be installed somewhere else, then issue :

./configure -prefix=/opt/PostgreSQL/9.3.

Prefix means the directory where you want to install it. Choose accordingly. This step will take some time, So, be patient 😉

You may run into a few errors like : –

configure: error: readline library not found
configure: error: zlib library not found.

To fix it, install these packages.

readline-devel.x86_64 & zlib-devel.x86_64

Make sure to use packages for your architecture.

Build installer & run installer. Now that we have configured the source, we can now make the installer & install PostgreSQL. Just issue

make
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!