andywar65 My post above with the custom Postgresql install instructions would probably be more suitable if you need a version greater than v14. You can just swap in the new version in the instructions, to something like below. And yes, you would need to import your old DB if you want to carry it over. This just sets up an empty database.
#Download, install, and configure
source scl_source enable devtoolset-11 # Ignore if on an Almalinux server
cd ~/apps/psql
wget https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.gz
tar zxf postgresql-15.19.tar.gz
export PGHOME="$HOME/apps/psql"
export PGDATA="$PGHOME/pgdata"
./postgresql-15.19/configure --prefix="$PGHOME"
make
make install
#Initialize and set superuser password **DO NOT SKIP**
#Enter a strong password when prompted.
#The database superuser will be your shell username.
"$PGHOME/bin/initdb" -D "$PGDATA" -E UTF8 -A scram-sha-256 -W
#Set your assigned port
sed -i 's/#port = 5432/port = 15481/g' "$PGDATA/postgresql.conf"
#Remove build files
rm -rf postgresql-15.19 postgresql-15.19.tar.gz Makefile
#Version check
./bin/postgres -V
#Expected: postgres (PostgreSQL) 15.19
#Start and connect
~/apps/psql/bin/pg_ctl -D ~/apps/psql/pgdata -l ~/apps/psql/logfile start
~/apps/psql/bin/psql -h localhost -p 15481 -d postgres -U your_shelluser
#Inside psql, quit with:
\q
#Commands to stop, start, restart, and connect
~/apps/psql/bin/pg_ctl -D ~/apps/psql/pgdata stop
~/apps/psql/bin/pg_ctl -D ~/apps/psql/pgdata -l ~/apps/psql/logfile start
~/apps/psql/bin/pg_ctl -D ~/apps/psql/pgdata -l ~/apps/psql/logfile restart
~/apps/psql/bin/psql -h localhost -p 15481 -d postgres -U your_shelluser