-
Notifications
You must be signed in to change notification settings - Fork 56
Building PostgreSQL 14.x
Below versions of PostgreSQL are available in respective distributions at the time of creation of these build instructions:
- RHEL (8.8, 8.10) have
10.23
- RHEL (9.2, 9.4) have
13.14
- SLES (12 SP5, 15 SP5, 15 SP6) have
14.13
- Ubuntu (20.04, 22.04, 24.04) have
14.13
The instructions provided below specify the steps to build PostgreSQL version 14.13 on Linux on IBM Z for
- RHEL(8.8, 8.10, 9.2, 9.4)
Note: On Ubuntu (20.04, 22.04, 24.04), PostgreSQL(postgresql-14) can be installed using APT repository maintained by community here
General Notes:
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/
will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you want to build postgreSQL using manual steps, go to STEP 2.
Use the following commands to build postgreSQL using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/PostgreSQL/14.13/build_postgresql.sh
# Build PostgreSQL
bash build_postgresql.sh
If the build completes successfully, follow the notes at the end of the script and go to STEP 3. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.
export SOURCE_ROOT=/<source_root>/
- RHEL (8.8, 8.10, 9.2, 9.4)
sudo yum install -y git wget gcc gcc-c++ tar make readline-devel zlib-devel bison flex glibc-langpack-en procps-ng diffutils patch curl
sudo useradd postgres -m -U
sudo passwd postgres
Note: Please note that /usr/sbin
is available in PATH
environment variable.
cd $SOURCE_ROOT
wget https://ftp.postgresql.org/pub/source/v14.13/postgresql-14.13.tar.gz
tar xf postgresql-14.13.tar.gz
cd $SOURCE_ROOT/postgresql-14.13
./configure
make
make check
sudo make install
Note: Before you run make check
make sure LANG environment variable is not set. unset LANG
if it is already set.
export PATH=$PATH:/usr/local/pgsql/bin
sudo mkdir -p /usr/local/pgsql/data
sudo chown postgres:postgres /usr/local/pgsql/data
su postgres -s /bin/bash
export PATH=$PATH:/usr/local/pgsql/bin
cd /home/postgres/
initdb -D /usr/local/pgsql/data/
Note: Please make sure the directory /usr/local/
has sufficient read and execute permissions when initializing.
pg_ctl -D /usr/local/pgsql/data/ -l logfile start
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.