Install libs for compile source postgres
apt-get install build-essential libreadline-dev zlib1g-dev llvm-7 clang-7
if use Debian 11 or Ubuntu 22.04, change llvm and clang to current version
apt-get install build-essential libreadline-dev zlib1g-dev llvm clang libicu-dev pkg-config
Extract postgres source to postgres-source-dir (change lllvm-7 to current version llvm path)
mkdir -p /home/userpath/postgres/pgsql
cd postgres-source-dir
./configure --with-llvm LLVM_CONFIG="/usr/lib/llvm-7/bin/llvm-config" --prefix=/home/userpath/postgres/pgsql
make
make install
if you want to install postgres-contrib extension, you can compile it
cd contrib
make
make install
cd \
mkdir postgres
cd postgres
mkdir database
mkdir pgsql
pgsql/bin/initdb --locale en_US.UTF-8 -D database
Now you can setup everything with new portable postgres include 2 folder: pgsql and database
No comments:
Post a Comment