Saturday, August 09, 2014

How to install postgresql 9.3 in Ubuntu 14.04

Postgresql is very useful with ruby on rails to reduce complexity.

You can open terminal with "Ctrl + Alt + T" and run this command for install postgresql:

sudo sh -c "echo 'deb precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - | sudo apt-key add - 
sudo apt-get update
sudo apt-get install postgresql-common 
sudo apt-get install postgresql-9.3 libpq-dev

For login into postgresql
sudo -u postgres psql
If you want to create user named "sachin" then use this:
sudo -u postgres createuser sachin -s
For change password with user:
sudo -u postgres psql
postgres=# \password sachin


Post a Comment