Skip to content

Instantly share code, notes, and snippets.

@harshalbhakta
Created July 29, 2014 09:40
Show Gist options
  • Select an option

  • Save harshalbhakta/67938957f2708d29f482 to your computer and use it in GitHub Desktop.

Select an option

Save harshalbhakta/67938957f2708d29f482 to your computer and use it in GitHub Desktop.
Setup Postgresql with hstore on Ubuntu Server 12.04 LTS.
$ add-apt-repository ppa:pitti/postgresql
$ apt-get update
$ apt-get install postgresql libpq-dev
$ sudo -u postgres psql

postgres=# \password
Enter new password: 
Enter it again:

# Create database & user
$ sudo -u postgres psql

postgres=# create user blog with password 'secret';
CREATE ROLE
postgres=# create database blog_production owner blog;
CREATE DATABASE

# If using hstore use below command.

$ sudo su - postgres
$ psql learnaptdbprd -c 'create extension hstore;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment