Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

How to Install PostgreSQL 9.6 on Ubuntu ?

PostgreSQL is a powerful, open source object-relational database system. It has more than 16 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness.
 
I am going to share few steps to install PostgreSQL 9.6 on Ubuntu 16.04.

First, check the version of Ubuntu:
lsb_release -sc
You need to add the latest PostgreSQL repository for the latest version, otherwise It will install old version. This is for trusty version.
sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
Update and Install PostgreSQL 9.6:
sudo apt-get update
sudo apt-get install postgresql-9.6
Default postgres super user and postgres database is created. You need to set a password for the postgres super user. 
ubuntu@:~$ sudo passwd postgres
Enter new UNIX password:****
Retype new UNIX password:****
passwd: password updated successfully
If service is not started, you can start the PostgreSQL service. 
sudo service postgresql start
Connect PostgreSQL server using postgres user:
ubuntu@:~$ su postgres
Password:****
Create a sample database:
createdb database_name
Connect to that database:
psql -d database_name
Create a sample table:
create table Test (rno integer);
Exit to database session:
\q
Exit to PostgreSQL server:
exit

Comments

Popular posts from this blog

Top 40 Highest Paying URL Shortener Companies - Best URL Shorteners To Earn Fast

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

PostgreSQL ALTER TABLE ... SET LOGGED / UNLOGGED

How To Configure pglogical | streaming replication for PostgreSQL