1依赖安装
gcc、gcc-c++、zlib-devel、readline-devel
例如: centos7 :
yum install readline-devel
2配置编译
./configure --prefix=目录 CFLAGS=“-O0 -g” --enable-tap-tests --enable-cassert --with-libxml --enable-debug
mke distclean
make install
3启动
到刚才配置的 目录下 找到/bin/
./initdb -D data
./psql postgres
遇到的问题?
congfig遇到的问题以及解决命令
$ ./configure --enable-tap-tests
… fails, whining about IPC::Run
$ sudo yum install perl-IPC-Run
$ ./configure --enable-tap-tests
… fails, whining about prove
… figure out where Fedora hides prove
$ sudo yum install perl-Test-Harness
$ ./configure --enable-tap-tests
… works this time
… make, then
$ make -j check-world
… runs for awhile and then fails
… much excavation finds a complaint about Test::More not being installed
… figure out where Fedora hides Test::More
$ sudo yum install perl-Test-Simple
$ make -j check-world
… runs for awhile and then fails
… much excavation finds a complaint about Time::HiRes not being installed
$ sudo yum install perl-Time-HiRes
$ make -j check-world
问题1:configure: error: dtrace not found
解决方案: yum install systemtap systemtap-sdt-devel
问题2:configure: error: could not determine flags for linking embedded Perl.
This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
installed.
解决方案:yum install perl-ExtUtils-Embed -y
问题3:checking how to link an embedded Python application… configure: error: could not find shared library for Python
解决方案:这个一般的原因是当OS中有多个python版本,需要指定python路径,./configure 参数加上PYTHON=/usr/bin/python2.7 指定python
问题4:configure: error: library ‘pam’ is required for PAM
解决方案:yum install pam pam-devel -y
问题5:configure: error: library ‘xml2’ (version >= 2.6.23) is required for XML support
解决方案:yum install libxml2 libxml2-devel -y
问题6:configure: error: library ‘xslt’ is required for XSLT support
解决方案:yum install libxslt libxslt-devel -y
问题7:make的时候会出现e-secure-openssl.c:1413: PQsslAttribute 的多重定义
fe-secure.o:fe-secure.c:(.text+0x150):第一次在此定义
解决方案:这个一般是因为之前安装过,重新安装的时候会报这个错,解决方法就是在重新安装之前执行一下:make clean
原文链接:https://blog.csdn.net/danqingc/article/details/98486514/