postgresql12.2编译
依赖环境
这台机器编译过nginx,有一些基础环境
yum install -y gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
补充安装了readline就行了
yum install -y readline-devel
下载编译
wget https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.gz
tar xzvf postgresql-12.2.tar.gz
cd postgresql-12.2/./configure -prefix=/usr/local/pgsql
make && make install
直至
PostgreSQL installation complete.
编译安装成功
PostGIS编译
依赖环境
这个是为greenplum准备的完整编译环境(postgis)
yum install -y epel-release
yum install -y \apr-devel \bison \bzip2-devel \cmake3 \flex \gcc \gcc-c++ \krb5-devel \libcurl-devel \libevent-devel \libkadm5 \libyaml-devel \libxml2-devel \libzstd-devel \openssl-devel \perl-ExtUtils-Embed \python-devel \python-pip \readline-devel \xerces-c-devel \zlib-develyum install -y gdal-devel
编译libgeos
wget http://download.osgeo.org/geos/geos-3.8.0.tar.bz2
yum install -y bzip2
tar jxf geos-3.8.0.tar.bz2
cd geos-3.8.0/
#编译
./configure -prefix=/usr/local/geos && make && make install
编译proj4
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz #http://download.osgeo.org/proj/proj-6.2.1.tar.gz 注意项目需要的是4.x,其他版本不可用
tar zxf proj-4.9.3.tar.gz
cd proj-4.9.3yum install -y libsqlite3x-devel
./configure -prefix=/usr/local/proj4 && make && make install
postgis2.5.4编译
wget https://download.osgeo.org/postgis/source/postgis-2.5.4.tar.gz
tar xzvf postgis-2.5.4.tar.gz
cd postgis-2.5.4/./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-geosconfig=/usr/local/geos/bin/geos-config --with-projdir=/usr/local/proj4
make && make install
成功