Install PostgreSQL from Source on RHEL/CentOS

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

转载于:https://my.oschina.net/feanlau/blog/3068441

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值