构建pg系统要求
1、GUN make version 3.80以上,其他的make或者老的make版本都不行,其他操作 系统使用make
gmake –version
2、必须有ISO/ANSI C compiler(至少C89-compliant),建议使用GCC的最新版本, 但pg是使用来自不同厂商的编译器生成
3、tar用来解压源代码包,除了gzip和bzip2之外
4、默认是用GUN readline 库,为pg提供非常有用和强大的命令行记录功能,可以指定 configure 的—without-readline选项不需要此功能
5、默认使用zlib的压缩库,可以指定configure 的—without-zlib选项不需要此功能
获取源安装包
http://www.postgresql.org/download/
gunzip postgresql-x.x.x.tar.gz
tar xf postgresql-x.x.x.tar
.gz文件使用gunzip,.bz2文件使用bunzib
安装程序
1、配置
为你的系统配置source tree和配置你的选项,通过运行下面脚本:
./configure
系统默认配置,客户端和应用程序仅仅需要C compiler,所有文件将默认安装 在/usr/local/pgsql下。
2、构建
gmake
3、回归测试
gmake check
4、安装文件
gmake install (root 用户)
gmake install-docs
安装后的设置
环境变量设置
PATH=/usr/local/pgsql/bin:$PATH
export PATH
MANPATH=/usr/local/pgsql/man:$MANPATH
export MANPATH