ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

postgresql源码安装

2021-10-11 13:31:03  阅读:187  来源: 互联网

标签:src postgresql postgres 安装 make 源码 12.6 config


1、创建用户和组

groupadd postgres

useradd -g postgres postgres

[root@test1 /]# groupadd postgres
[root@test1 /]# useradd -g postgres postgres

2、创建postfresql的安装目录

[root@test1 tmp]# mkdir -p /postgresql/2.6
[root@test1 tmp]# chown -R postgres:postgres /postgresql

3、编译

默认安装在/usr/local/pgsql目录下,可以通过--prefix指定安装目录

./configure --prefix=/postgres/12.6

[postgres@test1 postgresql-12.6]$ ./configure --prefix=/postgres/12.6
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for gcc... gcc
checking whether the C compiler works... yes
。。。。。。
configure: using CPPFLAGS= -D_GNU_SOURCE 
configure: using LDFLAGS=  -Wl,--as-needed
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/include/pg_config_ext.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/linux.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.linux to src/Makefile.port

注,在编译过程中,有报错,提示没有安装readline,但是readline缺失已经安装了,后来安装readline-devel后不报错。

报错信息如下:

checking for library containing readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

4、make

make all

[postgres@test1 postgresql-12.6]$ make all
make -C ./src/backend generated-headers
make[1]: Entering directory `/tmp/postgresql-12.6/src/backend'
make -C catalog distprep generated-header-symlinks
make[2]: Entering directory `/tmp/postgresql-12.6/src/backend/catalog'
make[2]: Nothing to be done for `distprep'.
。。。。。。
make -C config all
make[1]: Entering directory `/tmp/postgresql-12.6/config'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/postgresql-12.6/config'
All of PostgreSQL successfully made. Ready to install.
[postgres@test1 postgresql-12.6]$ 

5、make install

make install

[postgres@test1 postgresql-12.6]$ make install
make -C ./src/backend generated-headers
make[1]: Entering directory `/tmp/postgresql-12.6/src/backend'
make -C catalog distprep generated-header-symlinks
make[2]: Entering directory `/tmp/postgresql-12.6/src/backend/catalog'
make[2]: Nothing to be done for `distprep'.
。。。。。。
make[1]: Entering directory `/tmp/postgresql-12.6/config'
/bin/mkdir -p '/postgres/12.6/lib/pgxs/config'
/bin/install -c -m 755 ./install-sh '/postgres/12.6/lib/pgxs/config/install-sh'
/bin/install -c -m 755 ./missing '/postgres/12.6/lib/pgxs/config/missing'
make[1]: Leaving directory `/tmp/postgresql-12.6/config'
PostgreSQL installation complete.
[postgres@test1 postgresql-12.6]$ 

安装完成。

标签:src,postgresql,postgres,安装,make,源码,12.6,config
来源: https://blog.csdn.net/S1156578253/article/details/120700403

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有