1. 程式人生 > >centos7編譯PGSQL9.6並配置UUID

centos7編譯PGSQL9.6並配置UUID

library prefix install 不同 .rpm rect pgsql ref tor

系統版本:

centos7.2


# yum install readline-devel zlib-devel -y

如果不安裝以上兩個包,編譯postgresql就會報缺少相應包的錯誤,導致無法通過。


# yum install postgresql-contrib


http://mirror.centos.org/centos/7/os/x86_64/Packages/uuid-devel-1.6.2-26.el7.x86_64.rpm

版本和系統的uuid版本一樣,uuid-1.6.2-26.el7.x86_64

# rpm -ivh uuid-devel-1.6.2-26.el7.x86_64.rpm

如果不安裝以上的一個包,編譯postgresql就會報以下的錯誤:

# configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID"

如果源裏邊有這個包,可以使用yum進行安裝。


上傳包postgresql-9.6.3.tar.gz

# tar -zxf postgresql-9.6.3.tar.gz

# cd postgresql-9.6.3

# ./configure --prefix=/usr/local/postgresql --with-ossp-uuid

# make && make install


# cd contrib/uuid-ossp

# make && make install

上邊如果不編譯uuid-ossp,就會出現下面的錯誤:

postgres=# create extension "uuid-ossp";

ERROR: could not open extension control file "/usr/local/postgresql/share/extension/uuid-ossp.control": No such file or directory


# vi /etc/profile

export PGHOME=/usr/local/postgresql

export PGDATA=/data/pg_data

export PATH=$PATH:$PGHOME/bin


# source /etc/profile


其他基本上和之前的yum安裝的9.2版本的配置一樣,註意配置文件可能不同,按實際的來配置,如下面的配置文件:

# find / -name "recovery.conf.sample"

/usr/local/postgresql/share/recovery.conf.sample

/data/postgresql-9.6.3/src/backend/access/transam/recovery.conf.sample


# cp /usr/local/postgresql/share/recovery.conf.sample /data/pg_data/recovery.conf

centos7編譯PGSQL9.6並配置UUID