# Installing PostgreSQL 14 on RHEL 7.9
# Using RPM repository
| |
| yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm |
| |
| |
| yum install -y postgresql14-server |
| |
| |
| /usr/pgsql-14/bin/postgresql-14-setup initdb |
| systemctl enable postgresql-14 |
| systemctl start postgresql-14 |
| systemctl status postgresql-14 |
# Configuring PostgreSQL 14
- Adding environment variable.
| ~] |
| $ echo 'export PATH=/usr/pgsql-14/bin:$PATH' >> ~/.bash_profile |
| $ source ~/.bash_profile |
- Changing default user postgres password.
| $ psql |
| |
| postgres= |
| Enter new password for user "postgres": |
| Enter it again: |
| postgres= |
| postgres= |
# Management
| = |
| = |
| = |
| = |
| = |
| id | name |
| |
| 1 | a |
| (1 row) |
# Reference
・ https://www.postgresql.org/docs/
・ https://www.postgresql.org/download/linux/redhat/