How to Install PostgreSQL on Fedora 36 / Fedora 35 | Holhol24

1

PostgreSQL is a loose object-relational database control gadget (ORDBMS). It is to be had for Linux, FreeBSD, Solaris, Microsoft Windows, and macOS.

PostgreSQL was once evolved through the PostgreSQL Global Development Group and launched below the PostgreSQL License.

Here, we can see the way to set up PostgreSQL on Fedora 36 / Fedora 35.

Install PostgreSQL on Fedora 36

Setup PostgreSQL repository

PostgreSQL construction workforce gives programs thru a devoted repository for all Linux platforms, and the programs are brisker than the ones to be had within the OS repositories. So, configure the PostgreSQL repository through putting in the PostgreSQL repository package deal.

# Fedora 36

sudo dnf set up -y https://obtain.postgresql.org/pub/repos/yum/reporpms/F-36-x86_64/pgdg-fedora-repo-latest.noarch.rpm

# Fedora 35

sudo dnf set up -y https://obtain.postgresql.org/pub/repos/yum/reporpms/F-35-x86_64/pgdg-fedora-repo-latest.noarch.rpm

Install PostgreSQL

When scripting this publish, PostgreSQL v14,13,12,11, and 10 are to be had for Fedora. You can set up a selected model of PostgreSQL citing postgresql-server within the dnf command.

For instance, to put in PostgreSQL 14, use the beneath command.

sudo dnf set up -y postgresql14-server

Initialize PostgreSQL Server

After putting in PostgreSQL, it is important to initialize it prior to the usage of it for the primary time. Change the beneath command in response to the PostgreSQL model /usr/pgsql-/bin/postgresql--setup initdb.

sudo /usr/pgsql-14/bin/postgresql-14-setup initdb

PostgreSQL knowledge is usually discovered /var/lib/pgsql//knowledge/ listing.

After initializing the PostgreSQL database, get started the PostgreSQL carrier and allow it on gadget startup.

sudo systemctl allow --now postgresql-14

Finally, take a look at the standing of the PostgreSQL carrier.

sudo systemctl standing postgresql-14

Access PostgreSQL server

To create a database, log in as postgres (Linux consumer) after which get admission to the database the usage of the psql command. PSQL is an interactive terminal for operating with the PostgreSQL database.

$ sudo su -l postgres

$ psql

Output:

psql (14.4)
Type "help" for lend a hand.

postgres=#

Set password for postgres (Database administrator) consumer.

postgres=# password

Conclusion

That’s All. I’m hoping you might have discovered the way to set up PostgreSQL on Fedora 36 / Fedora 35.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More