How to install PostgreSQL 10 on Ubuntu 17.04

How to install PostgreSQL 10 on Ubuntu 17.04

In this tutorial, I will show you How to install PostgreSQL 10 on Ubuntu 17.04. You will see installation of  PostgreSQL 10 on Ubuntu step by step.

Before installing here is short description about PostgreSQL

install postgresql 10 on Ubuntu

PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation.

Related Post: How to install PostgreSQL 10 on Ubuntu 16.04

PostgreSQL Apt Repository

Firstly we need to add postgresql apt repository. Open /etc/apt/sources.list.d/pgdg.list and add the following line in that file.

sudo bash -c "echo deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main >> /etc/apt/sources.list.d/pgdg.list"

Import the signing key

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -

Source: https://www.postgresql.org/download/linux/ubuntu/

Update the package lists

apt -y update

See also: How to install postgrsql 9.6 on centos 7

Install Postgresql 10

apt-get install postgresql-10 postgresql-contrib libpq-dev

Start and enable Services of PostgreSQL

systemctl start postgresql

systemctl enable postgresql

Read Also: How to install postgresql on mac

PostgreSQL installation is done. If you want to use postgreSQL log in postgres account by typing following command

root@installvirtual:~# su - postgres
postgres@installvirtual:~$ psql
psql (10.0)
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
postgres=#

Now use the postgresql as you want to use. To get the help use \h command.

Read Next: How to backup postgresql database
Read Next: How to replicate postgresql database using bucardo

If you have any problem using this tutorial feel free to comment.

Consider sharing this article: