postgresql源码安装
2021/10/11 19:16:06
本文主要是介绍postgresql源码安装,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
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]$
安装完成。
这篇关于postgresql源码安装的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-05快速清空 PostgreSQL 数据库中的所有表格,让你的数据库重新焕然一新!
- 2024-01-04在PostgreSQL中创建角色:判断角色是否存在并创建
- 2023-05-16PostgreSQL一站式插件推荐 -- pg_enterprise_views
- 2022-11-22PostgreSQL 实时位置跟踪
- 2022-11-22如何将PostgreSQL插件移植到openGauss
- 2022-11-11PostgreSQL:修改数据库用户的密码
- 2022-11-06Windows 环境搭建 PostgreSQL 物理复制高可用架构数据库服务
- 2022-10-27Windows 环境搭建 PostgreSQL 逻辑复制高可用架构数据库服务
- 2022-10-11PostgreSql安装(Windows10版本)
- 2022-09-13PostgreSQL-Network Address类型操作和函数