DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Alexey has posted 28 posts at DZone. View Full User Profile

Postgres Installation On Ubuntu

  • submit to reddit

useradd postgres
sudo apt-get install postgresql postgresql-client postgresql-contrib

sudo -u postgres psql template1
template1=# ALTER USER postgres WITH PASSWORD ‘password’;
template1=# \q
sudo passwd -d postgres
sudo su postgres -c passwd

sudo -u postgres createuser myuser
sudo -u postgres createdb -O myuser mydatabase

sudo /etc/init.d/postgresql restart