Install Postgres Database latest version

Step 1: Add PostgreSQL Apt Repository

– Add PostgreSQL apt repository

# echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' >> /etc/apt/sources.list.d/pgdg.list

– Import the repository signing key, and update the package lists

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

Step 2: Install PostgreSQL

# sudo apt-get update
# sudo apt-get install postgresql-10

Step 3: Connect to PostgreSQL

– After installing PostgreSQL database server, by default PostgreSQL, will create a system account user ‘postgres’ and a user named ‘postgres’ with role ‘postgres’.

– To connect use the following commands:

# sudo su - postgres
# psql

 

Links and Resources :

http://yallalabs.com/linux/how-to-install-and-use-postgresql-10-on-ubuntu-16-04/

%d bloggers like this: