想考PCA认证的,请认真学习以下笔记(学霸笔记,必过过过)
wget https://ftp.postgresql.org/pub/source/v13.3/postgresql-13.3.tar.gz
yum install -y bison flex readline-devel zlib-deve1 zlib zlib-devel gcc openssl-devel
./configure --prefix=/PG/postgresql --with-openssl
gmake world && gmake install-world
chown -R postgres. /PG/postgresql
export PATH=/PG/postgresql/bin:$PATH
export PGDATA=/PG/postgresql/data
pg_ctl -D $PGDATA start
# 使用 system 进行管理:
vim /usr/lib/systemd/system/postgresql-13.service
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
Environment=PGPORT=5432
Environment=PGDATA=/PG/postgresql/data/
OOMScoreAdjust=-1000
ExecStart=/PG/postgresql/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -
w -t 300
ExecStop=/PG/postgresql/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/PG/postgresql/bin/pg_ctl reload -D ${PGDATA} -s
TimeoutSec=300
[Install]
WantedBy=multi-user.target
# 加载 system 配置:
systemctl daemon-reload
# 使用 systemctl 启动:
systemctl start postgresql-13.service
systemctl enable postgresql-13.service