PostgreSQL Database installation

 PostgreSQL Database installation 



1. Prechecks

Environment Check

PostgreSQL LTS

Application Compatibility

 

2. RPMS 

 rpm -qa make --version

 rpm -qa gcc

 rpm -qa readline-devel

 rpm -qa zlib-devel

 rpm -qa libicu-devel

 

3. Directories


/Software

/Cluster

/wal

/log

/backup

/archive


4. User and group 

User - Postgres,  group - dba


5. File setting inside config

ac_default_prefix=/usr/local

ac_default_prefix=/postgres_dbpoc2/software/


ac_default_prefix=/usr/local/pgsql

ac_default_prefix=/postgres_dbpoc2/software/pgsql


6.


./configure --without-zlib --without-readline --with-libxml 


1. Check your system for required dependencies

It tests for:


compilers (e.g., gcc, g++)

libraries

headers

tools like make, pkg-config, etc.


2. Detect system capabilities

The script looks at:


your OS

CPU architecture

available features

installed versions of libraries


3. Prepare the Makefiles

It creates the specific Makefile that matches your system, based on the checks above.



7.

make -j 8 

you’re telling the build system to start compiling the source code using the Makefile that was generated by



8.


make install

make install copies the compiled files (binaries, libraries, headers, etc.) from the build directory into system‑wide locations such as:


/usr/local/bin

/usr/local/lib

/usr/local/include

/usr/local/share


9.


useradd -m -d /home/postgres -c "Postgres User" -s /usr/bin/bash postgres



10. Cluster


base    pg_commit_ts  pg_hba.conf    pg_logical    pg_notify    pg_serial     pg_stat      pg_subtrans  pg_twophase  pg_wal   postgresql.auto.conf  postmaster.opts

global  pg_dynshmem   pg_ident.conf  pg_multixact  pg_replslot  pg_snapshots  pg_stat_tmp  pg_tblspc    PG_VERSION   pg_xact  postgresql.conf       postmaster.pid


/postgres_dbpoc2/software/pgsql/bin/initdb -D /postgres_dbpoc2/database/data01


 /postgres_dbpoc2/software/pgsql/bin/pg_ctl -D /postgres_dbpoc2/database/data01 -l logfile start

psql -U postpoc -p 5434 -d postgres --socket=/tmp/.s.PGSQL.5434;


/usr/local/pgsql/bin/psql -h /tmp -p 5434 -d postgres -U postpoc


/var/run/postgresql.

Comments