Install Postgresql 9.4 on Ubuntu 18.04

Step 1: Add PostgreSQL Apt Repository

$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
$ wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -

Step 2: Install PostgreSQL

$ sudo apt-get update
$ sudo apt-get upgrade

$ sudo apt-get install postgresql postgresql-contrib libpq-dev pgadmin3

Step 3: Connecting to PostgreSQL

$ sudo su - postgres
$ psql

To list the databases type following command

postgres-# \l

credit digital ocean

Tags:

Postgresql