dnf install -y https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-9-x86_64\/pgdg-redhat-repo-latest.noarch.rpm<\/pre>\nThen, you need to update your local package index with the following command:<\/p>\n
dnf update -y<\/pre>\nAt this point, you can install the PostgreSQL\u00a0 server with the following command:<\/p>\n
dnf install postgresql14 postgresql14-server<\/pre>\nOnce the installation is complete, initialize the PostgreSQL database with the following command:<\/p>\n
\/usr\/pgsql-14\/bin\/postgresql-14-setup initdb\r\nInitializing database ... OK<\/pre>\nStart and enable the PostgreSQL service.<\/p>\n
systemctl enable postgresql-14 && sudo systemctl start postgresql-14<\/pre>\nVerify your PostgreSQL installation by checking its version:<\/p>\n
psql -V<\/pre>\nOutput<\/strong>\r\npsql (PostgreSQL) 14.5<\/pre>\nCheck if the service is up and running:<\/p>\n
systemctl status postgresql-14<\/pre>\nYou should receive the following output:<\/p>\n
\u25cf postgresql-14.service - PostgreSQL 14 database server\r\n Loaded: loaded (\/usr\/lib\/systemd\/system\/postgresql-14.service; enabled; vendor preset: disabled)\r\n Active: active (running) since Fri 2022-09-23 22:21:44 CEST; 1min 25s ago\r\n Docs: https:\/\/www.postgresql.org\/docs\/14\/static\/\r\n Main PID: 26248 (postmaster)\r\n Tasks: 8 (limit: 5738)\r\n Memory: 17.1M\r\n CPU: 154ms\r\n CGroup: \/system.slice\/postgresql-14.service\r\n \u251c\u250026248 \/usr\/pgsql-14\/bin\/postmaster -D \/var\/lib\/pgsql\/14\/data\/\r\n \u251c\u250026249 \"postgres: logger \"\r\n \u251c\u250026251 \"postgres: checkpointer \"\r\n \u251c\u250026252 \"postgres: background writer \"\r\n \u251c\u250026253 \"postgres: walwriter \"\r\n \u251c\u250026254 \"postgres: autovacuum launcher \"\r\n \u251c\u250026255 \"postgres: stats collector \"\r\n \u2514\u250026256 \"postgres: logical replication launcher \"\r\n<\/pre>\nAnother way to check about the PostgreSQL service and port is to run the command below:<\/p>\n
netstat -tunlp | grep 5432<\/pre>\nYou should receive the following output:<\/p>\n
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 26248\/postmaster<\/pre>\n