For SLES 15 SP1, use the following two links to learn more about how to install and configure PostgreSQL 11.x: 
https://www.postgresql.org/download/linux/suse/
https://zypp.postgresql.org/howtozypp.php 

Based on the information from the links above, you can use the following approach to install and configure PostgreSQL 11.x on SLES 15 SP1:
zypper addrepo https://download.opensuse.org/repositories/server:/database:/postgresql/SLE_15_SP1/server:database:postgresql.repo

zypper --gpg-auto-import-keys refresh

zypper install postgresql11-server
or
zypper --non-interactive install postgresql11-server

mkdir -p /usr/local/pgsql/

chown -R postgres:postgres /usr/local/pgsql/

su postgres -c "/usr/lib/postgresql11/bin/initdb -D /usr/local/pgsql/data -A md5 --pwprompt"
or
su postgres -c "/usr/lib/postgresql11/bin/initdb -D /usr/local/pgsql/data --pwfile /usr/local/pgsql/postgres-password.txt  -A md5"
*where postgres-password.txt is a text file that has the password used for the postgres user.   

After configuring PostgreSQL, the file should be deleted.*
sed -i "s/32/0/g" /usr/local/pgsql/data/pg_hba.conf

sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /usr/local/pgsql/data/postgresql.conf

sed -i "s/#port = 5432/port = 5432/g" /usr/local/pgsql/data/postgresql.conf

sed -i "s|POSTGRES_DATADIR=\"~postgres/data\"|POSTGRES_DATADIR=\"/usr/local/pgsql/data\"|g" /etc/sysconfig/postgresql

systemctl enable "postgresql.service"

systemctl  
start postgresql.service

For RHEL 8, use the following link to learn about how to install and configure PostgreSQL 11.x:
https://www.postgresql.org/download/linux/redhat/

Based on the information from the link above, you can use the following approach to install and configure PostgreSQL 11.x on RHEL 8:

dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

dnf install postgresql11

dnf install postgresql11-server

mkdir -p /usr/local/pgsql/

chown -R postgres:postgres /usr/local/pgsql/

su postgres -c "/usr/pgsql-11/bin/initdb -D /usr/local/pgsql/data -A md5 --pwprompt"
or
su postgres -c "/usr/pgsql-11/bin/initdb -D /usr/local/pgsql/data --pwfile /usr/local/pgsql/postgres-password.txt  -A md5"
*where postgres-password.txt is a text file that has the password that will be utilized for the postgres user.  

After configuring PostgreSQL the file should be deleted.*

sed -i "s/32/0/g" /usr/local/pgsql/data/pg_hba.conf

sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /usr/local/pgsql/data/postgresql.conf

sed -i "s/#port = 5432/port = 5432/g" /usr/local/pgsql/data/postgresql.conf

mkdir -p /etc/systemd/system/postgresql-11.service.d

echo -e "[Service]\nEnvironment=PGDATA=/usr/local/pgsql/data" > /etc/systemd/system/postgresql-11.service.d/custom_pgdata.conf

systemctl enable postgresql-11

systemctl start postgresql-11

