这篇文章主要介绍“源码编译怎么安装pg11.5”,在日常操作中,相信很多人在源码编译怎么安装pg11.5问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”源码编译怎么安装pg11.5”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!yum -y install gcc*yum -y install python python-develyum -y install perl-ExtUtils-Embedyum -y install zlib-develyum -y install readline*groupadd -g 1001 postgres #新增用户组useradd -g 1001 -u 1001 postgres #新增用户[root@pg11 ~]# id postgresuid=1001(postgres) gid=1001(postgres) groups=1001(postgr免费主机域名es)passwd postgres #为用户设置密码mkdir -p /usr/local/pgsql11.5chown -R postgres:postgres /usr/local/pgsql11.5/mkdir -p /home/osdata/pgdatachown -R postgres:postgres /home/osdata/chmod 0700 /home/osdata/pgdataexport PATH=/usr/local/pgsql11.5/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/pgsql11.5/libexport PGDATA=/home/osdata/pgdata[root@pg11 pgsql11.5]# lltotal 19312-rw-r–r–. 1 root root 19773087 Oct 30 20:05 postgresql-11.5.tar.bz2[root@pg11 pgsql11.5]#chown -R postgres:postgres /usr/local/pgsql11.5/[root@pg11 pgsql11.5]# lltotal 19312-rw-r–r–. 1 postgres postgres 19773087 Oct 30 20:05 postgresql-11.5.tar.bz2tar -xvf postgresql-11.5.tar.bz2ln -sf /usr/local/pgsql11.5 /usr/local/pgsqlcd postgresql-11.5/./configure –prefix=/usr/local/pgsql11.5 –with-perl –with-python一次性把文档及附加模块全部进行编译和安装gmake world出现“PostgreSQL, contrib, and documentation successfully made. Ready to install.”说明编译成功gmake install-world出现“PostgreSQL, contrib, and documentation installation complete.”说明安装成功查看版本[postgres@pg11 postgresql-11.5]$ postgres –versionpostgres (PostgreSQL) 11.5initdb -D /home/osdata/pgdata/ -Wpg_ctl -D $PGDATA -l logfile start[postgres@pg ~]$ ps -ef|grep postgrespostgres 56625 1 0 Mar04 ? 00:00:03 /usr/local/pgsql11.5/bin/postgres -D /home/osdata/pgdatapostgres 56627 56625 0 Mar04 ? 00:00:00 postgres: checkpointer postgres 56628 56625 0 Mar04 ? 00:00:01 postgres: background writer postgres 56629 56625 0 Mar04 ? 00:00:01 postgres: walwriter postgres 56630 56625 0 Mar04 ? 00:00:05 postgres: autovacuum launcher postgres 56631 56625 0 Mar04 ? 00:00:10 postgres: stats collector postgres 56632 56625 0 Mar04 ? 00:00:00 postgres: logical replication launcher root 76758 76699 0 11:01 pts/0 00:00:00 su – postgrespostgres 76759 76758 0 11:01 pts/0 00:00:00 -bashpostgres 76797 76759 0 11:01 pts/0 00:00:00 psqlpostgres 76801 56625 0 11:01 ? 00:00:00 postgres: postgres test [local] idleroot 77192 77145 0 11:21 pts/1 00:00:00 su – postgrespostgres 77193 77192 0 11:21 pts/1 00:00:00 -bashpostgres 79582 77193 0 13:45 pts/1 00:00:00 ps -efpostgres 79583 77193 0 13:45 pts/1 00:00:00 grep –color=auto postgres查看数据库状态[postgres@pg11 ~]$ pg_ctl -D /home/osdata/pgdata/ statuspg_ctl: server is running (PID: 23588)/usr/local/pgsql11.5/bin/postgres “-D” “/home/osdata/pgdata”配置脚本服务在源码包的contrib目录中有linux、freebsd、macos适用的服务脚本[root@pg11 ~]免费主机域名# cd /usr/local/pgsql/postgresql-11.5/contrib/start-scripts[root@pg11 start-scripts]# lltotal 8-rw-r–r–. 1 postgres postgres 1467 Aug 6 2019 freebsd-rw-r–r–. 1 postgres postgres 3552 Aug 6 2019 linuxdrwxrwxr-x. 2 postgres postgres 84 Aug 6 2019 macos把名为linux的脚本拷贝到/etc/init.d目录,并且重命名为postgresql11[root@pg11 ~]# cp /usr/local/pgsql/postgresql-11.5/contrib/start-scripts/linux /etc/init.d/postgresql11[root@pg11 init.d]# chmod +x postgresql-11[root@pg11 init.d]# chkconfig postgresql-11 on[root@pg11 init.d]# chkconfig –list |grep postgresql-11postgresql-11 0:off 1:off 2:on 3:on 4:on 5:on 6:off[postgres@pg ~]$ psqlpsql (11.5)Type “help” for help.postgres=#到此,关于“源码编译怎么安装pg11.5”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注云技术网站,小编会继续努力为大家带来更多实用的文章!
相关推荐: update表中index索引列对原索引条目的操作是什么
本篇内容主要讲解“update表中index索引列对原索引条目的操作是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“update表中index索引列对原索引条目的操作是什么”吧!–将原索引条目删除,然后再插入…