[root@pgdb01 ~]#useradd postgres
[root@pgdb01 ~]#passwd postgres
Changing password for user postgres.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.[root@pgdb01 ~]#
[root@pgdb01 stage]#ls -ltr
total 27404
drwxrwxr-x. 6 root root 4096 Feb 18 2025 postgresql-17.4
-rw-r--r--. 1 root root 28056622 Feb 18 2025 postgresql-17.4.tar.gz [root@pgdb01 stage]#cd postgresql-17.4
[root@pgdb01 postgresql-17.4]#pwd/pg_Backup/stage/postgresql-17.4[root@pgdb01 postgresql-17.4]#
STEP 06
Configure Build
ℹ
Noteconfigure only checks system dependencies and prepares Makefiles. It records your install path (/pgbin/pgsql/17.4) internally but does not create the bin directory or install anything yet.
root@pgdb01 — /pg_Backup/stage/postgresql-17.4
[root@pgdb01 postgresql-17.4]#./configure--prefix=/pgbin/pgsql/17.4--with-pgport=5432 checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
...
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
configure complete.[root@pgdb01 postgresql-17.4]#
STEP 07
Compile Source
⚠
Error Encountered
First make run failed: missing Perl module FindBin.pm. Fixed by installing perl perl-core perl-ExtUtils-MakeMaker, then running make clean before retrying.
Step 1 — Fix missing Perl module
# First make attempt — error:[root@pgdb01 postgresql-17.4]#make
..
..
Can't locate FindBin.pm in @INC ...
make[2]: *** [Makefile:141: bki-stamp] Error 2
make: *** [src/Makefile.global:384: submake-generated-headers] Error 2
make -C ./src/backend generated-headers
... (compiling all source files) ...
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '.../src/test/perl'
make[1]: Leaving directory '.../src'
make -C config all
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '.../config'[root@pgdb01 postgresql-17.4]#
STEP 08
Install PostgreSQL
ℹ
Note
The /pgbin/pgsql/17.4/ bin directory is created automatically by make install.
The files belonging to this database system will be owned by user "postgres".
The database cluster will be initialized with locale "en_SG.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".fixing permissions on existing directory /pgData/pgsql/17.4 ... ok
fixing permissions on existing directory /pgWal/pgsql/17.4 ... 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/Singapore
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 -A/--auth-local.
Success. You can now start the database server using:
/pgbin/pgsql/17.4/bin/pg_ctl -D /pgData/pgsql/17.4 -l logfile start[postgres@pgdb01 ~]$
archive_mode = on & archive_command in postgresql.conf
Next 04
Take a Base Backup
pg_basebackup -D /pg_Backup/base ...
⚠ Disclaimer
Your use of any information or materials in this guide is entirely at your own risk. It is provided for educational purposes only. It has been tested internally; however, we do not guarantee it will work for you. Always validate in a test environment before applying to production.