PostgreSQL 11 Released. It is an open source object-relational, highly scalable, SQL-compliant database management system. PostgreSQL is developed at the University of California at Berkeley Computer Science Department. This article will help you to install PostgreSQL 11 on Fedora 30/29/28 system.
This article has been tested on Fedora 29.
Step 1 – Setup Yum Repository
Firstly you need to configure the PostgreSQL repository in your system. Use one of the below commands as per your operating system version.
## Fedora 30 rpm -Uvh https://yum.postgresql.org/11/fedora/fedora-30-x86_64/pgdg-fedora-repo-latest.noarch.rpm ## Fedora 29 rpm -Uvh https://yum.postgresql.org/11/fedora/fedora-29-x86_64/pgdg-fedora-repo-latest.noarch.rpm ## Fedora 28 rpm -Uvh https://yum.postgresql.org/11/fedora/fedora-28-x86_64/pgdg-fedora-repo-latest.noarch.rpm
For more details visit PostgreSQL repositories link page where you can get repository package rpm for various operating systems.
Step 2 – Install PostgreSQL 11 on Fedora
After enabling PostgreSQL yum repository in your system use following command to install PostgreSQL 11 on your system with yum package manager.
sudo dnf install postgresql11-server
This will also install some additional required packages on your system. Enter y to confirm and complete the installation process.
Step 3 – Initialize PGDATA
After that, you need to initialize the PostgreSQL instance. In other words, this will create a data directory and other configuration files on your system. To initialize database use below command.
Above command will take some time to initialize PostgreSQL first time. PGDATA environment variable contains the path of data directory.
PostgreSQL 11 data directory Path: /var/lib/pgsql/11/data/
Setp 4 – Start PostgreSQL Server
To start PostgreSQL service using the following command as per your operating systems. Also, enable PostgreSQL service to autostart on system boot.
sudo systemctl enable postgresql-11.service sudo systemctl start postgresql-11.service
Step 5 – Verify PostgreSQL Installation
After completing the above all steps. Your PostgreSQL 11 server is ready to use. Log in to postfix instance to verify the connection.
su - postgres -c "psql" psql (11.0) Type "help" for help. postgres=#
You may create a password for user postgres for security purpose.
In conclusion, You have successfully installed the PostgreSQL database server on Fedora 28/27/26 system.