oracle linux 10 +pg18 源码安装要点

9月25日PG18发布,赶紧下来看看。

环境:

    Oracle linux 10.0 + pg18.0


1. 建用户


   useradd postgres
   echo "sztech@4U" |passwd --stdin postgres


2.创建软件目录


   mkdir /software/pg18
   mkdir /pg18/soft
   mkdir /data

   chown postgres: /software/pg18  /data  /pg18/soft
   chmod -R 775 /data


3.下载源码到 /software/pg18


  cd /software/pg18
  wget https://ftp.postgresql.org/pub/s ... tgresql-18.0.tar.gz


4.解压源码


  tar -xvf postgresql-18.0.tar.gz


5.安装依赖包


  使用root用户执行
  yum install e2fsprogs-devel libuuid-devel perl-core
  yum install bison tcl tcl-devel perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel libicu-devel openldap-devel python3-devel gcc-c++ openssl-devel cmake gcc* readline-devel
  yum install docbook-dtds docbook-style-xsl libxml2 libxml2-devel libxslt libxslt-devel xmlto perl-XML-SAX


6.配置


  su - postgres
  cd /software/pg18/postgresql-18.0
  ./configure --prefix=/pg18/soft --with-openssl --with-pgport=5432 --with-tcl --with-perl --with-python --with-libxml --with-libxslt --with-uuid=e2fs --with-pam --with-ldap


7.编译


  gmake world


8.安装


  gmake install-world


9.配置环境变量


  vim /home/postgres/.bash_profile
   export PGHOME=/pg18/soft
   export PGDATA=/data/
   export PATH=$PGHOME/bin:$PATH
   export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH


10.初始化数据库


    /pg18/soft/bin/initdb -D /data --encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8


11.登录测试一下


   postgres@pg16:~$ psql
psql (18.0)
Type "help" for help.

postgres=# select version();
                                                 version                                                  
----------------------------------------------------------------------------------------------------------
PostgreSQL 18.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7), 64-bit
(1 row)

postgres=#

到此,PG18安装完成。
其他自动启动脚本,后续再搞,不影响使用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值