https://www.postgresql.org/ftp/source/
[root@localhost local]# tar -xf postgresql-15.0.tar.gz
[root@localhost postgresql-15.0]# ./configure --prefix=/usr/local/pgsql_15
[root@localhost postgresql-15.0]# make
[root@localhost postgresql-15.0]# make install
[root@localhost postgresql-15.0]#ln -sf /usr/local/pgsql15 /usr/local/pgsql15
[root@localhost pgsql_15.0]# adduser postgres
[root@localhost pgsql_15.0]# mkdir /usr/local/pgsql_15.0/data
[root@localhost local]# chown -R postgres:postgres /usr/local/pgsql_15.0
[root@localhost pgsql_15.0]# chown -R postgres:postgres /usr/local/pgsql_15.0/*
[root@localhost pgsql_15.0]# su - postgres
[postgres@localhost pgsql_15.0]$ /usr/local/pgsql_15.0/bin/initdb -D /usr/local/pgsql_15.0/data
[postgres@localhost ~]$ /usr/local/pgsql_15.0/bin/pg_ctl -D /usr/local/pgsql_15.0/data -l logfile start
[postgres@localhost ~]$ /usr/local/pgsql_15.0/bin/psql postgres
postgres=# ALTER ROLE postgres WITH PASSWORD ‘postgres’;
[postgres@localhost ~]$ vi ~/.bashrc
export PATH=/usr/local/pgsql14/bin:
P
A
T
H
e
x
p
o
r
t
L
D
L
I
B
R
A
R
Y
P
A
T
H
=
/
u
s
r
/
l
o
c
a
l
/
p
g
s
q
l
14
/
l
i
b
:
PATH export LD_LIBRARY_PATH=/usr/local/pgsql14/lib:
PATHexportLDLIBRARYPATH=/usr/local/pgsql14/lib:LD_LIBRARY_PATH
export PGDATA=/usr/local/pgsql14/data