CentOS 7 - PostgreSQL

Installation

# vim /etc/yum.repos.d/CentOS-Base.repo

[base]
...
exclude=postgresql*

[updates]
...
exclude=postgresql*

# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# yum install -y postgresql13-server
# /usr/pgsql-13/bin/postgresql-13-setup initdb
# systemctl start postgresql-13 && systemctl enable postgresql-13

Create database

# sudo -u postgres createdb database_name

Logging is with user via TCP

1. Setting a password for the postgres user

(On Linux systems, there is no default password set)

# sudo -u postgres psql postgres
\password postgres
<new_password>
<new_password>
\q

2. Allowing local connections