PostgreSQL is a cross-platform relational database management system (DBMS) which is also known as Postgres.
It is a free and open-source DBMS and it supports multiple operating systems including Linux, macOS, and Windows.
This DBMS allows those transactions that have ACID properties i.e. Atomicity, Consistency, Isolation, and Durability.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to fix Database related errors.
In this context, we shall look into how to install this relational DBMS on the Linux operating system.
To get PostgreSQL installed on your Linux Mint 20 system, you need to follow all the steps stated below:
i. For updating your Linux Mint 20 system, you should run the following command after launching the terminal by clicking on its shortcut icon:
sudo apt update
Once your system has updated all the necessary packages and dependencies, you will see the output on your terminal.
ii. Now it is the turn to upgrade your Linux Mint 20 system by running the following command in the terminal:
sudo apt upgrade
The up-gradation process will take a sufficient time to complete.
Once our Linux Mint 20 system has been successfully updated and upgraded, we are all set to install on it by running the following command in the terminal:
sudo apt install postgresql
During the execution of this command, as soon as you will be prompted to provide your confirmation, then do this by typing in "Y" for carrying on smoothly with your installation.
Before accessing the PostgreSQL console, we need to verify whether this service is active or not by checking its status. The status can be checked by running the following command in the terminal:
sudo systemctl status postgresql
Running this command will display the status. With this, you can verify that the PostgreSQL server is active. However, it will not be running, instead, it will show the "exited" status which means that you need to log in to the server.
For accessing the console, we first need to log in to the PostgreSQL server by running the following command in our terminal:
sudo –i –u postgres
When you will run this command, you will immediately be logged into the server.
Now for accessing the console, we will run the command stated below while being logged in to the PostgreSQL server:
psql
Running this command will take us straight to the console.
You can exit from the console at any time by typing "\q" in this console and then pressing the Enter key.