- Instalar os packages:
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql11
yum install postgresql11-server
yum install postgresql96-contrib
- Inicializar o banco de dados e habilitar o início automático:
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11
systemctl start postgresql-11
- Alterar senha do usuário e criar banco de dados:
sudo passwd postgres
su - postgres
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';"
psql postgres
CREATE DATABASE nomedobanco;
- Editar o arquivo '/var/lib/pgsql/11/data/pg_hba.conf' com as propriedades:
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
- Editar o arquivo '/var/lib/pgsql/11/data/postgresql.conf' as propriedades:
listen_addresses = '*'
datestyle = 'iso, dmy'