# PGSQL安裝
sudo yum install -y
sudoyum install -y postgresql15-server
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
# 修改數(shù)據(jù)庫(kù)目錄
- 默認(rèn)postgreql 安裝在/usr/pgsql-14,數(shù)據(jù)存儲(chǔ)目錄:/var/lib/pgsql/版本號(hào)/data
- 修改systemd : vi /usr/lib/systemd/system/postgresql-15.service
- 修改為Environment=PGDATA=/data/postgresql/data #修改成新的數(shù)據(jù)庫(kù)目錄
- 要先關(guān)閉數(shù)據(jù)庫(kù)
- /usr/pgsql-15/bin/postgresql-15-setup initdb
# 重啟
- su postgres
- /usr/local/pgsql-15.1/bin/pg_ctl -D? /var/lib/pgsql/15/data -l? /var/lib/pgsql/15/data/log/postgresql-test start
# 使用
export PATH=$PATH:/usr/local/pgsql-15.1/bin
sudo chown root.postgres /var/tmp
sudo chmod g+wx /var/tmp
psql -p 5435
git clone https://ghproxy.com/https://github.com/timescale/timescaledb.git
git checkout 2.11.x
./bootstrap -DUSE_OPENSSL=0 -DREGRESS_CHECKS=OFF
cd build && make
make install