Postgres : Don’t wait, Innovate!
Unlike my previous humorous blog posts about databases, this one takes a more serious tone. When I published a blog and proof of concept (POC) regarding native incremental backup in the upcoming PostgreSQL 17, my Oracle DBA friends expressed curiosity about how I was able to test PostgreSQL 17 ahead of its general availability announcement.
It’s a cultural norm for large companies running Oracle to exercise caution and typically upgrade only to what they consider a “stable release.” The timeline for determining stability can vary significantly, ranging from a few months to several years for some organizations. In the PostgreSQL community, however, there is a high level of activity, and due to its open-source nature, many are eager to explore development, beta, and release candidate versions in their test and development environments. Consequently, compiling the latest beta or release candidate version of PostgreSQL from source and experimenting with desired features is quite commonplace. The earlier you begin testing, the better prepared you will be for upgrades, and you’ll avoid lagging behind your peers in the PostgreSQL community.
Due to this cultural difference and the community’s remarkable dynamism, early versions of PostgreSQL (General Availability versions) tend to be very stable and relatively bug-free compared to similarly numbered versions from Oracle or MSSQL. Modern database team managers must recognize this significant distinction between PostgreSQL and their legacy database environments if they wish to remain competitive.
In this post, I will present a straightforward installation guide for PostgreSQL 17 RC1 on Ubuntu 24.04.1 (Noble Numbat), followed by an even simpler Docker installation. My aim is to keep it simple for those transitioning from Oracle.
A ) Compiling from The Source :
I am on Ubuntu noble for this test.
Step 1: Install Required Dependencies
sudo apt-get update
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev bison flex wget libicu-dev pkg-config
Step 2: Download PostgreSQL 17 RC1 Source Code
Download the PostgreSQL 17 RC1 source tarball from the official PostgreSQL FTP site.
wget https://ftp.postgresql.org/pub/source/v17rc1/postgresql-17rc1.tar.gz
Step 3: Extract the Tarball
tar -xzf postgresql-17rc1.tar.gz
cd postgresql-17rc1
Step 4: Configure the Build Environment
This command checks for necessary libraries and prepares the build environment.
./configure
Step 5: Compile PostgreSQL and Install
make
sudo make install
Step 6: Create Postgres User
sudo mkdir /usr/local/pgsql/data
sudo useradd -m -s /bin/bash postgres
sudo passwd postgres
sudo chown -R postgres:postgres /usr/local/pgsql/data
sudo -i -u postgres
Step 7: Initialize the cluster and start postgres.
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/psql -U postgres
B ) Install via docker
Pull the PostgreSQL 17 RC1 Docker image:
docker pull postgres:17rc1
Run PostgreSQL 17 RC1 in a Docker container:
docker run — name my_pg_container -e POSTGRES_PASSWORD=mysecretpassword -d postgres:17rc1
Verify that PostgreSQL is running:
docker ps
Access PostgreSQL 17 RC1 inside the Docker container:
docker exec -it my_pg_container psql -U postgres
I have used Postgres 17 RC1 for Demo and it is expected to get general availability soon but you can use similar method for next Postgres (PG18) Beta versions. By testing PostgreSQL early, you’re not only equipping yourself for future upgrades but also subtly contributing to the community’s growth and It is a positive feedback loop.