Hello Readers, Today I will be sharing methods of Postgres SQL installation on Linux. I know, I was away from the system for a while now, I apologize for it, but I have a great news, in past 2 years, I got a chance to explore Postgres SQL. Today I will be sharing methods of Postgres SQL installation on Linux. I will try to share the complete procedure step by step.
For Postgres SQL installation on Linux, we will try to cover following points –
- What is Postgres SQL
- Key features of Postgres SQL
- What are the prerequisites for Installation of Postgres SQL on Linux Machine.
- How to Download Postgres SQL
- What are different Methods are available for Installation of Postgres SQL on linux.
- We will learn each method of Postgres SQL on Linux one by one.
Table of Contents
What is Postgres SQL
PostgreSQL is a powerful, open-source object-relational database system that uses and extends the SQL language combined with many features. PostgreSQL comes with enterprise version and community version. EDB Postgres SQL and Aurora Postgres SQL are enterprise edition where you will pay EDB or AWS company for Technical Support and License to use it. And these companies will provide you added benefits and feature compared with community version.
You can read more about Postgres SQL from here – PostgreSQL: About
Key Features of Postgres SQL
- Extensibility
- Security
- Reliability, Disaster Recovery
- Concurrency, Performance
- Data Integrity
- Cross Platform Support
- ACID – It ensures Atomicity, Consistency, Isolation, and Durability of transactions
Prerequisites for Postgres SQL on Linux Machine
OS certification with Postgres SQL
You need to check if OS platform with version Os team will be releasing it to you is compatible with the Postgres Sql application team has requested to install. It’s always better to be part of initial implementation discussion where they will share the requirement with Infrastructure teams ( like storage team, OS team, Database Team etc).
So let your OS team know about minimum requirement of OS to run Postgres SQL say 16v.
Minimum Package Requirement
Please ask OS team to install following packages for you –
1. make
2. zlib
3. readline
4. gcc
Minimum Package requirement will come into picture when you are planning to use RPM or Source Code Method of Postgres SQL installation on Linux machine. For Yum method, you can skip it as Yum will take care of all the dependent packages for you.
Storage Requirement
It’s recommended to keep OS / filesystem and data directory of Postgres SQL bifurcated. So, you will check with application team, understand how much space their initial application implementation will use and how much data growth they are expecting. Ideally, we here start with minimum of 100GB in (UAT and development setups) . And based on consumption, we raise storage call.
Now in production you will try to keep separate mount point for wal-archive files, and datafiles.
How to Download and Install Postgres SQL on Linux
I will be showing you how to download and Install Postgres SQL Community Version for you
Before you learn how to download Postgres SQL, we need to understand Postgres SQL Installation can be done using three methods –
1. Postgres SQL installation on Linux using YUM
2. Postgres SQL installation on Linux using RPM
3. Postgres SQL installation on Linux using Source code Method.
How to download And Install Postgres SQL for YUM installation method
1. Go to PostgreSQL: Downloads (https://www.postgresql.org/download/)
2. Click on the version – favor of OS on which you are planning to install
Here I will choose Linux as I am planning to install it on CentOS favor.
3. Now I will select Red Hat/Rocky/AlmaLinux
4. Based on your selection you will be redirected to new link – in our case -I was redirected to following link –
PostgreSQL: Linux downloads (Red Hat family)
5. Now select Postgres SQL version, Select Platform, Select Architecture. Now it will create relevant script for installation –
6. Copy the script and save it in your Notepad.
7. Now you can provide these commands to your OS team member to execute it as root user, if you have root access you can execute it as follows –
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm sudo dnf -qy module disable postgresql ### We don't execute it sudo dnf install -y postgresql16-server Cluster initialization is done based on client requirement - sudo /usr/pgsql-16/bin/postgresql-16-setup initdb sudo systemctl enable postgresql-16 sudo systemctl start postgresql-16
8. Install the repo rpm
[root@localhost ~]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm Updating Subscription Management repositories. Unable to read consumer identity This system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register. Last metadata expiration check: 0:17:49 ago on Mon 26 Aug 2024 12:17:50 AM IST. pgdg-redhat-repo-latest.noarch.rpm 6.9 kB/s | 12 kB 00:01 Dependencies resolved. ======================================================================================================================================================================== Package Architecture Version Repository Size ======================================================================================================================================================================== Installing: pgdg-redhat-repo noarch 42.0-43PGDG @commandline 12 k Transaction Summary ======================================================================================================================================================================== Install 1 Package Total size: 12 k Installed size: 15 k Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : pgdg-redhat-repo-42.0-43PGDG.noarch 1/1 Verifying : pgdg-redhat-repo-42.0-43PGDG.noarch 1/1 Installed products updated. Installed: pgdg-redhat-repo-42.0-43PGDG.noarch Complete! [root@localhost ~]#
9. Now execute the next command from notepad where it will install the packages
[root@localhost ~]# dnf install -y postgresql16-server Updating Subscription Management repositories. Unable to read consumer identity This system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register. PostgreSQL 13 for RHEL / Rocky / AlmaLinux 9 - x86_64 267 kB/s | 825 kB 00:03 PostgreSQL 12 for RHEL / Rocky / AlmaLinux 9 - x86_64 501 B/s | 659 B 00:01 PostgreSQL 12 for RHEL / Rocky / AlmaLinux 9 - x86_64 2.4 MB/s | 2.4 kB 00:00 Importing GPG key 0x08B40D20: Userid : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>" Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20 From : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL PostgreSQL 12 for RHEL / Rocky / AlmaLinux 9 - x86_64 215 kB/s | 758 kB 00:03 Last metadata expiration check: 0:00:01 ago on Mon 26 Aug 2024 12:36:51 AM IST. Dependencies resolved. ======================================================================================================================================================================== Package Architecture Version Repository Size ======================================================================================================================================================================== Installing: postgresql16-server x86_64 16.4-1PGDG.rhel9 pgdg16 6.7 M Installing dependencies: postgresql16 x86_64 16.4-1PGDG.rhel9 pgdg16 1.8 M postgresql16-libs x86_64 16.4-1PGDG.rhel9 pgdg16 334 k Transaction Summary ======================================================================================================================================================================== Install 3 Packages Total download size: 8.8 M Installed size: 40 M Downloading Packages: (1/3): postgresql16-libs-16.4-1PGDG.rhel9.x86_64.rpm 324 kB/s | 334 kB 00:01 (2/3): postgresql16-16.4-1PGDG.rhel9.x86_64.rpm 1.2 MB/s | 1.8 MB 00:01 (3/3): postgresql16-server-16.4-1PGDG.rhel9.x86_64.rpm 2.1 MB/s | 6.7 MB 00:03 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 2.7 MB/s | 8.8 MB 00:03 PostgreSQL 16 for RHEL / Rocky / AlmaLinux 9 - x86_64 2.4 MB/s | 2.4 kB 00:00 Importing GPG key 0x08B40D20: Userid : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>" Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20 From : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : postgresql16-libs-16.4-1PGDG.rhel9.x86_64 1/3 Running scriptlet: postgresql16-libs-16.4-1PGDG.rhel9.x86_64 1/3 Installing : postgresql16-16.4-1PGDG.rhel9.x86_64 2/3 Running scriptlet: postgresql16-16.4-1PGDG.rhel9.x86_64 2/3 Running scriptlet: postgresql16-server-16.4-1PGDG.rhel9.x86_64 3/3 Installing : postgresql16-server-16.4-1PGDG.rhel9.x86_64 3/3 Running scriptlet: postgresql16-server-16.4-1PGDG.rhel9.x86_64 3/3 Verifying : postgresql16-16.4-1PGDG.rhel9.x86_64 1/3 Verifying : postgresql16-libs-16.4-1PGDG.rhel9.x86_64 2/3 Verifying : postgresql16-server-16.4-1PGDG.rhel9.x86_64 3/3 Installed products updated. Installed: postgresql16-16.4-1PGDG.rhel9.x86_64 postgresql16-libs-16.4-1PGDG.rhel9.x86_64 postgresql16-server-16.4-1PGDG.rhel9.x86_64 Complete! [root@localhost ~]#
10. Now you can check what all packages are installed on your system.
[root@localhost ~]# rpm -qa | grep postgre postgresql16-libs-16.4-1PGDG.rhel9.x86_64 postgresql16-16.4-1PGDG.rhel9.x86_64 postgresql16-server-16.4-1PGDG.rhel9.x86_64 [root@localhost ~]# [root@localhost system]# cd /usr/pgsql-16/ bin/ lib/ share/ [root@localhost system]# cd /usr/pgsql-16/ [root@localhost pgsql-16]# ls -ltr total 12 drwxr-xr-x. 7 root root 4096 Aug 26 00:36 share drwxr-xr-x. 3 root root 4096 Aug 26 00:36 lib drwxr-xr-x. 2 root root 4096 Aug 26 00:36 bin [root@localhost pgsql-16]# [root@localhost bin]# ls -ltr total 13068 -rwxr-xr-x. 1 root root 9617 Aug 7 12:26 postgresql-16-setup -rwxr-xr-x. 1 root root 2167 Aug 7 12:26 postgresql-16-check-db-dir -rwxr-xr-x. 1 root root 71504 Aug 7 12:26 vacuumdb -rwxr-xr-x. 1 root root 66984 Aug 7 12:26 reindexdb -rwxr-xr-x. 1 root root 721296 Aug 7 12:26 psql -rwxr-xr-x. 1 root root 10147384 Aug 7 12:26 postgres -rwxr-xr-x. 1 root root 96120 Aug 7 12:26 pg_waldump -rwxr-xr-x. 1 root root 83640 Aug 7 12:26 pg_verifybackup -rwxr-xr-x. 1 root root 141880 Aug 7 12:26 pg_upgrade -rwxr-xr-x. 1 root root 32824 Aug 7 12:26 pg_test_timing -rwxr-xr-x. 1 root root 41296 Aug 7 12:26 pg_test_fsync -rwxr-xr-x. 1 root root 104648 Aug 7 12:26 pg_rewind -rwxr-xr-x. 1 root root 173272 Aug 7 12:26 pg_restore -rwxr-xr-x. 1 root root 49856 Aug 7 12:26 pg_resetwal -rwxr-xr-x. 1 root root 92168 Aug 7 12:26 pg_receivewal -rwxr-xr-x. 1 root root 41256 Aug 7 12:26 pg_isready -rwxr-xr-x. 1 root root 92656 Aug 7 12:26 pg_dumpall -rwxr-xr-x. 1 root root 413864 Aug 7 12:26 pg_dump -rwxr-xr-x. 1 root root 58336 Aug 7 12:26 pg_ctl -rwxr-xr-x. 1 root root 45184 Aug 7 12:26 pg_controldata -rwxr-xr-x. 1 root root 36832 Aug 7 12:26 pg_config -rwxr-xr-x. 1 root root 49792 Aug 7 12:26 pg_checksums -rwxr-xr-x. 1 root root 163104 Aug 7 12:26 pgbench -rwxr-xr-x. 1 root root 138848 Aug 7 12:26 pg_basebackup -rwxr-xr-x. 1 root root 41032 Aug 7 12:26 pg_archivecleanup -rwxr-xr-x. 1 root root 113400 Aug 7 12:26 initdb -rwxr-xr-x. 1 root root 49776 Aug 7 12:26 dropuser -rwxr-xr-x. 1 root root 49840 Aug 7 12:26 dropdb -rwxr-xr-x. 1 root root 58864 Aug 7 12:26 createuser -rwxr-xr-x. 1 root root 58560 Aug 7 12:26 createdb -rwxr-xr-x. 1 root root 54280 Aug 7 12:26 clusterdb
11. Next step is to Initialize the cluster.
[root@localhost ~]# /usr/pgsql-16/bin/postgresql-16-setup initdb Initializing database ... OK
12. Check the initialization of cluster logfile
[root@localhost ~]# cd /var/lib/pgsql/16 [root@localhost 16]# cat initdb.log The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgsql/16/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok Success. You can now start the database server using: /usr/pgsql-16/bin/pg_ctl -D /var/lib/pgsql/16/data/ -l logfile start [root@localhost 16]# pwd /var/lib/pgsql/16 [root@localhost 16]#
13. Enable and start the Postgres SQL service
[root@localhost 16]# systemctl enable postgresql-16 Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-16.service → /usr/lib/systemd/system/postgresql-16.service. [root@localhost 16]# [root@localhost 16]# systemctl start postgresql-16 [root@localhost 16]# [root@localhost 16]# systemctl status postgresql-16.service ● postgresql-16.service - PostgreSQL 16 database server Loaded: loaded (/usr/lib/systemd/system/postgresql-16.service; enabled; preset: disabled) Active: active (running) since Mon 2024-08-26 11:41:07 IST; 8s ago Docs: https://www.postgresql.org/docs/16/static/ Process: 3381 ExecStartPre=/usr/pgsql-16/bin/postgresql-16-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS) Main PID: 3386 (postgres) Tasks: 7 (limit: 10948) Memory: 17.7M CPU: 104ms CGroup: /system.slice/postgresql-16.service ├─3386 /usr/pgsql-16/bin/postgres -D /var/lib/pgsql/16/data/ ├─3387 "postgres: logger " ├─3388 "postgres: checkpointer " ├─3389 "postgres: background writer " ├─3391 "postgres: walwriter " ├─3392 "postgres: autovacuum launcher " └─3393 "postgres: logical replication launcher " Aug 26 11:41:07 localhost.localdomain systemd[1]: Starting PostgreSQL 16 database server... Aug 26 11:41:07 localhost.localdomain postgres[3386]: 2024-08-26 11:41:07.506 IST [3386] LOG: redirecting log output to logging collector process Aug 26 11:41:07 localhost.localdomain postgres[3386]: 2024-08-26 11:41:07.506 IST [3386] HINT: Future log output will appear in directory "log". Aug 26 11:41:07 localhost.localdomain systemd[1]: Started PostgreSQL 16 database server. [root@localhost 16]# [root@localhost ~]# ps -ef | grep postgres postgres 3386 1 0 11:41 ? 00:00:00 /usr/pgsql-16/bin/postgres -D /var/lib/pgsql/16/data/ postgres 3387 3386 0 11:41 ? 00:00:00 postgres: logger postgres 3388 3386 0 11:41 ? 00:00:00 postgres: checkpointer postgres 3389 3386 0 11:41 ? 00:00:00 postgres: background writer postgres 3391 3386 0 11:41 ? 00:00:00 postgres: walwriter postgres 3392 3386 0 11:41 ? 00:00:00 postgres: autovacuum launcher postgres 3393 3386 0 11:41 ? 00:00:00 postgres: logical replication launcher root 4879 4027 0 18:57 pts/0 00:00:00 grep --color=auto postgres [root@localhost ~]#
14. Switch to postgres user which got created when you installed the Postgres SQL on linux machine.
[root@localhost ~]# su - postgres [postgres@localhost ~]$ psql -U postgres -p 5432 psql (16.4) Type "help" for help. postgres=# postgres=# \l List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges -----------+----------+----------+-----------------+-------------+-------------+------------+-----------+----------------------- postgres | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | template0 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres (3 rows) postgres=#
How to download and Install Postgres SQL for RPM installation method
1. You can use following link – RPM Chart – PostgreSQL YUM Repository
2. Click on the version you are looking for based on OS Platform type.
3. You will be redirected to new Page. In my case I was redirected to Index of /pub/repos/yum/16/redhat/rhel-9-x86_64/ (postgresql.org)
4. Use browsers find and search for following packages –
a.postgresql16-16.4-1PGDG.rhel9.x86_64.rpm 07-Aug-2024 11:46 1836506
b.postgresql16-libs-16.4-1PGDG.rhel9.x86_64.rpm 07-Aug-2024 11:47 341572
c.postgresql16-server-16.4-1PGDG.rhel9.x86_64.rpm 07-Aug-2024 11:46 7019695
d.postgresql16-contrib-16.4-1PGDG.rhel9.x86_64.rpm 07-Aug-2024 11:47 741121
5. Download these above-mentioned packages (based on your version and type of OS) and transfer it on your server.
6. Follow the sequence for the installation as each RPM is dependent on each other.
[root@localhost oracledbworld]# rpm -ivh postgresql15-libs-15.8-1PGDG.rhel9.x86_64.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:postgresql15-libs-15.8-1PGDG.rhel################################# [100%] [root@localhost oracledbworld]# rpm -ivh postgresql15-15.8-1PGDG.rhel9.x86_64.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:postgresql15-15.8-1PGDG.rhel9 ################################# [100%] [root@localhost oracledbworld]# rpm -ivh postgresql15-server-15.8-1PGDG.rhel9.x86_64.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:postgresql15-server-15.8-1PGDG.rh################################# [100%] [root@localhost oracledbworld]# [root@localhost oracledbworld]# rpm -ivh postgresql15-contrib-15.8-1PGDG.rhel9.x86_64.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:postgresql15-contrib-15.8-1PGDG.r################################# [100%] [root@localhost oracledbworld]#
7. Let’s initialize the cluster
[postgres@localhost data]$ pwd /var/lib/pgsql/15/data [postgres@localhost data]$ /usr/pgsql-15/bin/initdb --pgdata /var/lib/pgsql/15/data The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgsql/15/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/pgsql-15/bin/pg_ctl -D /var/lib/pgsql/15/data -l logfile start
8. Now lets start the Postgres Sql with the help of the command which is provided.
[postgres@localhost data]$ /usr/pgsql-15/bin/pg_ctl -D /var/lib/pgsql/15/data -l logfile start waiting for server to start.... done server started [postgres@localhost data]$
9. Now lets check if all Postgres SQL database services are running and I am able to connect or not.
[postgres@localhost data]$ /usr/pgsql-15/bin/psql -U postgres -p 5434 psql (15.8) Type "help" for help. postgres=# postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges -----------+----------+----------+-------------+-------------+------------+-----------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | =c/postgres + | | | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc | =c/postgres + | | | | | | | postgres=CTc/postgres (3 rows) postgres=# \q [postgres@localhost data]$ ps -ef | grep post root 5285 4027 0 21:20 pts/0 00:00:00 su - postgres postgres 5286 5285 0 21:20 pts/0 00:00:00 -bash postgres 5411 1 0 21:27 ? 00:00:00 /usr/pgsql-15/bin/postgres -D /var/lib/pgsql/15/data postgres 5412 5411 0 21:27 ? 00:00:00 postgres: logger postgres 5413 5411 0 21:27 ? 00:00:00 postgres: checkpointer postgres 5414 5411 0 21:27 ? 00:00:00 postgres: background writer postgres 5416 5411 0 21:27 ? 00:00:00 postgres: walwriter postgres 5417 5411 0 21:27 ? 00:00:00 postgres: autovacuum launcher postgres 5418 5411 0 21:27 ? 00:00:00 postgres: logical replication launcher postgres 5423 5286 0 21:28 pts/0 00:00:00 ps -ef postgres 5424 5286 0 21:28 pts/0 00:00:00 grep --color=auto post [postgres@localhost data]$
postgresql-lib | libraries files |
---|---|
postgresql-server | core database server |
postgresql-contrib | additional supplied modules |
postgresql-devel | libraries and headers for C language development |
How to download and Install Postgres SQL for Source Code installation method
1. Click on FTP link of Postgres SQL official website – PostgreSQL: File Browser
2. Click on the version you are looking for. I have selected v16.4 as I was looking for latest Postgres SQL
3. Now download the tar file.
4. Upload the file which is downloaded on your target server.
5. Extract the Tar file in a location (You will need 200MB at least for extraction of tar file.)
gunzip postgresql-16.4.tar.gz tar -xvf postgresql-16.4.tar It will create a directory in same location. [root@localhost postgres]#ls -ltr drwxrwxrwx. 6 postgres postgres 4096 Aug 26 21:42 postgresql-16.4 [root@localhost postgres]#cd postgresql-16.4
6. Execute ./configure (if you don’t have icu and readline rpm installed on your system, then you can use –without-icu –without-readline switches to ignore those package checks)
[root@localhost postgresql-16.4]# ./configure --without-icu --without-readline checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking which template to use... linux checking whether NLS is wanted... no checking for default port number... 5432 checking for block size... 8kB checking for segment size... 1GB checking for WAL block size... 8kB checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for gcc option to accept ISO C99... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for gawk... gawk checking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes checking whether gcc supports -Werror=vla, for CFLAGS... yes checking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no checking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no checking whether gcc supports -Wendif-labels, for CFLAGS... yes checking whether g++ supports -Wendif-labels, for CXXFLAGS... yes checking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes checking whether gcc supports -Wimplicit-fallthrough=3, for CFLAGS... yes checking whether g++ supports -Wimplicit-fallthrough=3, for CXXFLAGS... yes checking whether gcc supports -Wcast-function-type, for CFLAGS... yes checking whether g++ supports -Wcast-function-type, for CXXFLAGS... yes checking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes checking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... yes checking whether gcc supports -Wformat-security, for CFLAGS... yes checking whether g++ supports -Wformat-security, for CXXFLAGS... yes checking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes checking whether gcc supports -fwrapv, for CFLAGS... yes checking whether g++ supports -fwrapv, for CXXFLAGS... yes checking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no checking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes checking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes checking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no checking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no checking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes checking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes checking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no checking whether gcc supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes checking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... yes checking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... yes checking whether the C compiler still works... yes checking how to run the C preprocessor... gcc -E checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking allow thread-safe client libraries... yes checking whether to build with ICU support... no checking whether to build with Tcl... no checking whether to build Perl modules... no checking whether to build Python modules... no checking whether to build with GSSAPI support... no checking whether to build with PAM support... no checking whether to build with BSD Authentication support... no checking whether to build with LDAP support... no checking whether to build with Bonjour support... no checking whether to build with SELinux support... no checking whether to build with systemd support... no checking whether to build with XML support... no checking whether to build with LZ4 support... no checking whether to build with ZSTD support... no checking for strip... strip checking whether it is possible to strip libraries... yes checking for ar... ar checking for a BSD-compatible install... /usr/bin/install -c checking for tar... /usr/bin/tar checking whether ln -s works... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for bison... no configure: WARNING: *** Without Bison you will not be able to build PostgreSQL from Git nor *** change any of the parser definition files. You can obtain Bison from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this, because the Bison *** output is pre-generated.) checking for flex... no configure: WARNING: *** Without Flex you will not be able to build PostgreSQL from Git nor *** change any of the scanner definition files. You can obtain Flex from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this because the Flex *** output is pre-generated.) checking for perl... /usr/bin/perl configure: using perl 5.32.1 checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether gcc is Clang... no checking whether pthreads work with -pthread... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking whether more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for strerror_r... yes checking whether strerror_r returns int... no checking for main in -lm... yes checking for library containing setproctitle... no checking for library containing dlsym... none required checking for library containing socket... none required checking for library containing getopt_long... none required checking for library containing shm_open... none required checking for library containing shm_unlink... none required checking for library containing clock_gettime... none required checking for library containing fdatasync... none required checking for library containing shmget... none required checking for library containing backtrace_symbols... none required checking for library containing pthread_barrier_wait... none required checking for inflate in -lz... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking atomic.h usability... no checking atomic.h presence... no checking for atomic.h... no checking copyfile.h usability... no checking copyfile.h presence... no checking for copyfile.h... no checking execinfo.h usability... yes checking execinfo.h presence... yes checking for execinfo.h... yes checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking ifaddrs.h usability... yes checking ifaddrs.h presence... yes checking for ifaddrs.h... yes checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking mbarrier.h usability... no checking mbarrier.h presence... no checking for mbarrier.h... no checking sys/epoll.h usability... yes checking sys/epoll.h presence... yes checking for sys/epoll.h... yes checking sys/event.h usability... no checking sys/event.h presence... no checking for sys/event.h... no checking sys/personality.h usability... yes checking sys/personality.h presence... yes checking for sys/personality.h... yes checking sys/prctl.h usability... yes checking sys/prctl.h presence... yes checking for sys/prctl.h... yes checking sys/procctl.h usability... no checking sys/procctl.h presence... no checking for sys/procctl.h... no checking sys/signalfd.h usability... yes checking sys/signalfd.h presence... yes checking for sys/signalfd.h... yes checking sys/ucred.h usability... no checking sys/ucred.h presence... no checking for sys/ucred.h... no checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking ucred.h usability... no checking ucred.h presence... no checking for ucred.h... no checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking for lz4... no checking for zstd... no checking for openssl... /usr/bin/openssl configure: using openssl: OpenSSL 3.2.2 4 Jun 2024 (Library: OpenSSL 3.2.2 4 Jun 2024) checking whether byte ordering is bigendian... no checking for inline... inline checking for printf format archetype... gnu_printf checking for _Static_assert... yes checking for typeof... typeof checking for __builtin_types_compatible_p... yes checking for __builtin_constant_p... yes checking for __builtin_unreachable... yes checking for computed goto support... yes checking for struct tm.tm_zone... yes checking for union semun... no checking for socklen_t... yes checking for struct sockaddr.sa_len... no checking for locale_t... yes checking for C/C++ restrict keyword... __restrict checking for struct option... yes checking for z_streamp... yes checking whether assembler supports x86_64 popcntq... yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking size of off_t... 8 checking size of bool... 1 checking for int timezone... yes checking for wcstombs_l declaration... no checking for backtrace_symbols... yes checking for copyfile... no checking for getifaddrs... yes checking for getpeerucred... no checking for inet_pton... yes checking for kqueue... no checking for mbstowcs_l... no checking for memset_s... no checking for posix_fallocate... yes checking for ppoll... yes checking for pthread_is_threaded_np... no checking for setproctitle... no checking for setproctitle_fast... no checking for strchrnul... yes checking for strsignal... yes checking for syncfs... yes checking for sync_file_range... yes checking for uselocale... yes checking for wcstombs_l... no checking for __builtin_bswap16... yes checking for __builtin_bswap32... yes checking for __builtin_bswap64... yes checking for __builtin_clz... yes checking for __builtin_ctz... yes checking for __builtin_popcount... yes checking for __builtin_frame_address... yes checking for _LARGEFILE_SOURCE value needed for large files... no checking how gcc reports undeclared, standard C functions... error checking for posix_fadvise... yes checking whether posix_fadvise is declared... yes checking whether fdatasync is declared... yes checking whether strlcat is declared... no checking whether strlcpy is declared... no checking whether strnlen is declared... yes checking whether preadv is declared... yes checking whether pwritev is declared... yes checking whether F_FULLFSYNC is declared... no checking for explicit_bzero... yes checking for getopt... yes checking for getpeereid... no checking for inet_aton... yes checking for mkdtemp... yes checking for strlcat... no checking for strlcpy... no checking for strnlen... yes checking for pthread_barrier_wait... yes checking for getopt_long... yes checking for syslog... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for opterr... yes checking for optreset... no checking test program... ok checking whether long int is 64 bits... yes checking for __builtin_mul_overflow... yes checking size of void *... 8 checking size of size_t... 8 checking size of long... 8 checking alignment of short... 2 checking alignment of int... 4 checking alignment of long... 8 checking alignment of double... 8 checking for int8... no checking for uint8... no checking for int64... no checking for uint64... no checking for __int128... yes checking for __int128 alignment bug... ok checking alignment of PG_INT128_TYPE... 16 checking for builtin __sync char locking functions... yes checking for builtin __sync int32 locking functions... yes checking for builtin __sync int32 atomic operations... yes checking for builtin __sync int64 atomic operations... yes checking for builtin __atomic int32 atomic operations... yes checking for builtin __atomic int64 atomic operations... yes checking for __get_cpuid... yes checking for __cpuid... no checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... yes checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no checking which CRC-32C implementation to use... SSE 4.2 checking for library containing sem_init... none required checking which semaphore API to use... unnamed POSIX checking which random number source to use... /dev/urandom checking for /dev/urandom... yes checking for xmllint... /usr/bin/xmllint checking for xsltproc... /usr/bin/xsltproc checking for fop... no checking for dbtoepub... no checking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes checking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes configure: using compiler=gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-2) configure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 configure: using CPPFLAGS= -D_GNU_SOURCE configure: using LDFLAGS= -Wl,--as-needed configure: creating ./config.status config.status: creating GNUmakefile config.status: creating src/Makefile.global config.status: creating src/include/pg_config.h config.status: creating src/include/pg_config_ext.h config.status: creating src/interfaces/ecpg/include/ecpg_config.h config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c config.status: linking src/include/port/linux.h to src/include/pg_config_os.h config.status: linking src/makefiles/Makefile.linux to src/Makefile.port [root@localhost postgresql-16.4]# [root@localhost postgresql-16.4]# ./configure --without-icu --without-readline checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking which template to use... linux checking whether NLS is wanted... no checking for default port number... 5432 checking for block size... 8kB checking for segment size... 1GB checking for WAL block size... 8kB checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for gcc option to accept ISO C99... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for gawk... gawk checking whether gcc supports -Wdeclaration-after-statement, for CFLAGS... yes checking whether gcc supports -Werror=vla, for CFLAGS... yes checking whether gcc supports -Werror=unguarded-availability-new, for CFLAGS... no checking whether g++ supports -Werror=unguarded-availability-new, for CXXFLAGS... no checking whether gcc supports -Wendif-labels, for CFLAGS... yes checking whether g++ supports -Wendif-labels, for CXXFLAGS... yes checking whether gcc supports -Wmissing-format-attribute, for CFLAGS... yes checking whether g++ supports -Wmissing-format-attribute, for CXXFLAGS... yes checking whether gcc supports -Wimplicit-fallthrough=3, for CFLAGS... yes checking whether g++ supports -Wimplicit-fallthrough=3, for CXXFLAGS... yes checking whether gcc supports -Wcast-function-type, for CFLAGS... yes checking whether g++ supports -Wcast-function-type, for CXXFLAGS... yes checking whether gcc supports -Wshadow=compatible-local, for CFLAGS... yes checking whether g++ supports -Wshadow=compatible-local, for CXXFLAGS... yes checking whether gcc supports -Wformat-security, for CFLAGS... yes checking whether g++ supports -Wformat-security, for CXXFLAGS... yes checking whether gcc supports -fno-strict-aliasing, for CFLAGS... yes checking whether g++ supports -fno-strict-aliasing, for CXXFLAGS... yes checking whether gcc supports -fwrapv, for CFLAGS... yes checking whether g++ supports -fwrapv, for CXXFLAGS... yes checking whether gcc supports -fexcess-precision=standard, for CFLAGS... yes checking whether g++ supports -fexcess-precision=standard, for CXXFLAGS... no checking whether gcc supports -funroll-loops, for CFLAGS_UNROLL_LOOPS... yes checking whether gcc supports -ftree-vectorize, for CFLAGS_VECTORIZE... yes checking whether gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no checking whether gcc supports -Wcompound-token-split-by-macro, for NOT_THE_CFLAGS... no checking whether gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes checking whether gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes checking whether gcc supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... no checking whether gcc supports -fvisibility=hidden, for CFLAGS_SL_MODULE... yes checking whether g++ supports -fvisibility=hidden, for CXXFLAGS_SL_MODULE... yes checking whether g++ supports -fvisibility-inlines-hidden, for CXXFLAGS_SL_MODULE... yes checking whether the C compiler still works... yes checking how to run the C preprocessor... gcc -E checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking allow thread-safe client libraries... yes checking whether to build with ICU support... no checking whether to build with Tcl... no checking whether to build Perl modules... no checking whether to build Python modules... no checking whether to build with GSSAPI support... no checking whether to build with PAM support... no checking whether to build with BSD Authentication support... no checking whether to build with LDAP support... no checking whether to build with Bonjour support... no checking whether to build with SELinux support... no checking whether to build with systemd support... no checking whether to build with XML support... no checking whether to build with LZ4 support... no checking whether to build with ZSTD support... no checking for strip... strip checking whether it is possible to strip libraries... yes checking for ar... ar checking for a BSD-compatible install... /usr/bin/install -c checking for tar... /usr/bin/tar checking whether ln -s works... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for bison... no configure: WARNING: *** Without Bison you will not be able to build PostgreSQL from Git nor *** change any of the parser definition files. You can obtain Bison from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this, because the Bison *** output is pre-generated.) checking for flex... no configure: WARNING: *** Without Flex you will not be able to build PostgreSQL from Git nor *** change any of the scanner definition files. You can obtain Flex from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this because the Flex *** output is pre-generated.) checking for perl... /usr/bin/perl configure: using perl 5.32.1 checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether gcc is Clang... no checking whether pthreads work with -pthread... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking whether more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for strerror_r... yes checking whether strerror_r returns int... no checking for main in -lm... yes checking for library containing setproctitle... no checking for library containing dlsym... none required checking for library containing socket... none required checking for library containing getopt_long... none required checking for library containing shm_open... none required checking for library containing shm_unlink... none required checking for library containing clock_gettime... none required checking for library containing fdatasync... none required checking for library containing shmget... none required checking for library containing backtrace_symbols... none required checking for library containing pthread_barrier_wait... none required checking for inflate in -lz... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking atomic.h usability... no checking atomic.h presence... no checking for atomic.h... no checking copyfile.h usability... no checking copyfile.h presence... no checking for copyfile.h... no checking execinfo.h usability... yes checking execinfo.h presence... yes checking for execinfo.h... yes checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking ifaddrs.h usability... yes checking ifaddrs.h presence... yes checking for ifaddrs.h... yes checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking mbarrier.h usability... no checking mbarrier.h presence... no checking for mbarrier.h... no checking sys/epoll.h usability... yes checking sys/epoll.h presence... yes checking for sys/epoll.h... yes checking sys/event.h usability... no checking sys/event.h presence... no checking for sys/event.h... no checking sys/personality.h usability... yes checking sys/personality.h presence... yes checking for sys/personality.h... yes checking sys/prctl.h usability... yes checking sys/prctl.h presence... yes checking for sys/prctl.h... yes checking sys/procctl.h usability... no checking sys/procctl.h presence... no checking for sys/procctl.h... no checking sys/signalfd.h usability... yes checking sys/signalfd.h presence... yes checking for sys/signalfd.h... yes checking sys/ucred.h usability... no checking sys/ucred.h presence... no checking for sys/ucred.h... no checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking ucred.h usability... no checking ucred.h presence... no checking for ucred.h... no checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking for lz4... no checking for zstd... no checking for openssl... /usr/bin/openssl configure: using openssl: OpenSSL 3.2.2 4 Jun 2024 (Library: OpenSSL 3.2.2 4 Jun 2024) checking whether byte ordering is bigendian... no checking for inline... inline checking for printf format archetype... gnu_printf checking for _Static_assert... yes checking for typeof... typeof checking for __builtin_types_compatible_p... yes checking for __builtin_constant_p... yes checking for __builtin_unreachable... yes checking for computed goto support... yes checking for struct tm.tm_zone... yes checking for union semun... no checking for socklen_t... yes checking for struct sockaddr.sa_len... no checking for locale_t... yes checking for C/C++ restrict keyword... __restrict checking for struct option... yes checking for z_streamp... yes checking whether assembler supports x86_64 popcntq... yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking size of off_t... 8 checking size of bool... 1 checking for int timezone... yes checking for wcstombs_l declaration... no checking for backtrace_symbols... yes checking for copyfile... no checking for getifaddrs... yes checking for getpeerucred... no checking for inet_pton... yes checking for kqueue... no checking for mbstowcs_l... no checking for memset_s... no checking for posix_fallocate... yes checking for ppoll... yes checking for pthread_is_threaded_np... no checking for setproctitle... no checking for setproctitle_fast... no checking for strchrnul... yes checking for strsignal... yes checking for syncfs... yes checking for sync_file_range... yes checking for uselocale... yes checking for wcstombs_l... no checking for __builtin_bswap16... yes checking for __builtin_bswap32... yes checking for __builtin_bswap64... yes checking for __builtin_clz... yes checking for __builtin_ctz... yes checking for __builtin_popcount... yes checking for __builtin_frame_address... yes checking for _LARGEFILE_SOURCE value needed for large files... no checking how gcc reports undeclared, standard C functions... error checking for posix_fadvise... yes checking whether posix_fadvise is declared... yes checking whether fdatasync is declared... yes checking whether strlcat is declared... no checking whether strlcpy is declared... no checking whether strnlen is declared... yes checking whether preadv is declared... yes checking whether pwritev is declared... yes checking whether F_FULLFSYNC is declared... no checking for explicit_bzero... yes checking for getopt... yes checking for getpeereid... no checking for inet_aton... yes checking for mkdtemp... yes checking for strlcat... no checking for strlcpy... no checking for strnlen... yes checking for pthread_barrier_wait... yes checking for getopt_long... yes checking for syslog... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for opterr... yes checking for optreset... no checking test program... ok checking whether long int is 64 bits... yes checking for __builtin_mul_overflow... yes checking size of void *... 8 checking size of size_t... 8 checking size of long... 8 checking alignment of short... 2 checking alignment of int... 4 checking alignment of long... 8 checking alignment of double... 8 checking for int8... no checking for uint8... no checking for int64... no checking for uint64... no checking for __int128... yes checking for __int128 alignment bug... ok checking alignment of PG_INT128_TYPE... 16 checking for builtin __sync char locking functions... yes checking for builtin __sync int32 locking functions... yes checking for builtin __sync int32 atomic operations... yes checking for builtin __sync int64 atomic operations... yes checking for builtin __atomic int32 atomic operations... yes checking for builtin __atomic int64 atomic operations... yes checking for __get_cpuid... yes checking for __cpuid... no checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... yes checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... no checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... no checking which CRC-32C implementation to use... SSE 4.2 checking for library containing sem_init... none required checking which semaphore API to use... unnamed POSIX checking which random number source to use... /dev/urandom checking for /dev/urandom... yes checking for xmllint... /usr/bin/xmllint checking for xsltproc... /usr/bin/xsltproc checking for fop... no checking for dbtoepub... no checking whether gcc supports -Wl,--as-needed, for LDFLAGS... yes checking whether gcc supports -Wl,--export-dynamic, for LDFLAGS_EX_BE... yes configure: using compiler=gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-2) configure: using CFLAGS=-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 configure: using CPPFLAGS= -D_GNU_SOURCE configure: using LDFLAGS= -Wl,--as-needed configure: creating ./config.status config.status: creating GNUmakefile config.status: creating src/Makefile.global config.status: creating src/include/pg_config.h config.status: creating src/include/pg_config_ext.h config.status: creating src/interfaces/ecpg/include/ecpg_config.h config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c config.status: linking src/include/port/linux.h to src/include/pg_config_os.h config.status: linking src/makefiles/Makefile.linux to src/Makefile.port [root@localhost postgresql-16.4]#
7. Now execute make install
[root@localhost postgresql-16.4]# make install <trimmed output> /usr/bin/mkdir -p '/usr/local/pgsql/lib/pgxs/src' /usr/bin/install -c -m 644 Makefile.global '/usr/local/pgsql/lib/pgxs/src/Makefile.global' /usr/bin/install -c -m 644 Makefile.port '/usr/local/pgsql/lib/pgxs/src/Makefile.port' /usr/bin/install -c -m 644 ./Makefile.shlib '/usr/local/pgsql/lib/pgxs/src/Makefile.shlib' /usr/bin/install -c -m 644 ./nls-global.mk '/usr/local/pgsql/lib/pgxs/src/nls-global.mk' make[1]: Leaving directory '/home/postgres/postgresql-16.4/src' make -C config install make[1]: Entering directory '/home/postgres/postgresql-16.4/config' /usr/bin/mkdir -p '/usr/local/pgsql/lib/pgxs/config' /usr/bin/install -c -m 755 ./install-sh '/usr/local/pgsql/lib/pgxs/config/install-sh' /usr/bin/install -c -m 755 ./missing '/usr/local/pgsql/lib/pgxs/config/missing' make[1]: Leaving directory '/home/postgres/postgresql-16.4/config' [root@localhost postgresql-16.4]#
8. Create the user if you haven’t created it on your server, as source code method doesn’t create it for you (for me since I have used the same machine, postgres user was already created with yum installation.)
useradd postgres passwd postgres
9. Initialize the cluster
[postgres@localhost ORACLEDBWORLD]$ /usr/local/pgsql/bin/initdb -D /var/lib/pgsql/ORACLEDBWORLD The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgsql/ORACLEDBWORLD ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/local/pgsql/bin/pg_ctl -D /var/lib/pgsql/ORACLEDBWORLD -l logfile start [postgres@localhost ORACLEDBWORLD]$
10. Start the database services.
[postgres@localhost ORACLEDBWORLD]$ /usr/local/pgsql/bin/pg_ctl -D /var/lib/pgsql/ORACLEDBWORLD -l logfile start waiting for server to start.... done server started [postgres@localhost ORACLEDBWORLD]$cd /usr/local/pgsql/bin/ [postgres@localhost bin]$ ps -ef | grep postgres root 16821 4027 0 22:01 pts/0 00:00:00 su - postgres postgres 16822 16821 0 22:01 pts/0 00:00:00 -bash postgres 16903 1 0 22:03 ? 00:00:00 /usr/local/pgsql/bin/postgres -D /var/lib/pgsql/ORACLEDBWORLD postgres 16904 16903 0 22:03 ? 00:00:00 postgres: checkpointer postgres 16905 16903 0 22:03 ? 00:00:00 postgres: background writer postgres 16907 16903 0 22:03 ? 00:00:00 postgres: walwriter postgres 16908 16903 0 22:03 ? 00:00:00 postgres: autovacuum launcher postgres 16909 16903 0 22:03 ? 00:00:00 postgres: logical replication launcher postgres 16953 16822 0 22:04 pts/0 00:00:00 ps -ef postgres 16954 16822 0 22:04 pts/0 00:00:00 grep --color=auto postgres [postgres@localhost bin]$ ./psql -U postgres -p 5432 psql (16.4) Type "help" for help. postgres=# postgres=# \l List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges -----------+----------+----------+-----------------+-------------+-------------+------------+-----------+----------------------- postgres | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | template0 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres (3 rows)