postgres install - ghdrako/doc_snipets GitHub Wiki
Binary install
cat /etc/os-release 
NAME="Red Hat Enterprise Linux"
- Follow instruction https://www.postgresql.org/download
 - https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-9-x86_64/
 - Install
 
yum localinstall postgresql15-libs-15.0-1PGDG.rhel8.x86_64.rpm postgresql15-15.0-1PGDG.rhel8.x86_64.rpm postgresql15-server-15.0-1PGDG.rhel8.x86_64.rpm -y
- Inicialize:
 
# /usr/pgsql-15/bin/postgresql-15-setup initdb
- Sturtup
 
systemctl start postgresql-15.service
systemctl status postgresql-15.service
systemctl enable postgresql-15.service
Installation from source
download the latest version of PostgreSQL from their official website at https://ftp.postgresql.org/pub/source/v15.0/ after select your host operating system and version and follow the installation instructions.
- tar -xzf postgresql-15.0.tar.gz
 - useradd -d /home/postgres/ postgres
 
mkdir -p /pg_install/pgv150 
mkdir -p /pg_data/DATA
chown -R postgres:pos
tgres /pg_install/pgv150 
chown -R postgres:postgres /pg_data/DATA
cd postgresql-15.0 
./configure --prefix=/pg_install/pgv150/
make
make install
- Inicjalize database
 
su - postgres 
/pg_install/pgv150/bin/initdb -D /pg_data/DATA/
- start the database cluster
 
VI postgres.conf
/pg_install/pgv150/bin/pg_ctl -D /pg_data/DATA/ -l logfile start