PostgreSQL

Install PostgreSQL 10 on Ubuntu

PostgreSQL, also known as Postgres, is a free, open-source, and advanced social database administration framework with a worldwide community of thousands of clients, companies, and organizations. PostgreSQL is a database software that emphasizes SQL compliance, and it is widely used across the globe. The first version of PostgreSQL came in 1996, and its latest version in the market is the 13.1 version of the software, which was developed and finally released on November 12, 2020. PostgreSQL allows users to perform stored procedures in various programming languages, including C++, Java, and Visual Basic, among others. The following article shows you how to download and install PostgreSQL 10 in Ubuntu 20.04. PostgreSQL 10 contains outstanding advances to effectively execute the divide and conquer technique, containing local, consistent replication, explanatory table partitioning, and progressed query parallelism.

Starting the Installation

First, navigate to the official PostgreSQL website at the following URL: https://www.postgresql.org.


After you open the link, a window will appear onscreen. Click the Download button shown on this screen.

After you click the Download button, another window will open. Scroll down, and click Ubuntu under the Binary Packages heading.

Next, you need to refresh the Ubuntu OS package repository cache. Issue the following command to update the cache:

$ sudo apt-get update

Finalizing the Installation

At this time, you have completed all the hard work and are almost ready to install PostgreSQL 10. You just need one more command to install this software. Issue the following command to install PostgreSQL 10 on your system.

$ sudo apt-get install postgresql-10

After you enter and run this command, a new window will open that will hold some of the key details about the installation and the items to be installed. Press Y then Enter to continue the installation.

Wait for a few seconds, and the installation will complete. It does not take much time to install the software; the installation should be complete after a little while.

Once the software has been installed successfully, run some tests to verify that it has been installed correctly. Enter the following command to check whether the software is running correctly:

$ sudo systemctl status postgresql

As you can see from the output, PostgreSQL is running.

Creating and Setting a Profile

Now that you have completed the installation, you will only be able to log in to PostgreSQL as a ‘Postgres’ user. To access the software without using a Postgres user, you will have to create other users and databases from this login.

So, log in as a Postgres user and set up a password for the Postgres user by entering the following command:

$ sudo passwd postgres

After this, you can log into the system as a Postgres user by issuing the following command:

$ su - postgres

After logging into the interface, as a user, you should have access to the command-line interface of PostgreSQL. To obtain the command-line interface, run the following command:

$ psql

Now, you have access to the command-line interface, and you can write commands and text in PostgreSQL. You can also view the prompt that appears to run other PostgreSQL commands.

Conclusion

In conclusion, this article provided a complete and detailed overview of the procedure required to install PostgreSQL 10 in Ubuntu 20.04 Focal Fossa.

About the author

Younis Said

I am a freelancing software project developer, a software engineering graduate and a content writer. I love working with Linux and open-source software.