Skip to content

Instantly share code, notes, and snippets.

@mribica
Created October 15, 2012 11:43
Show Gist options
  • Save mribica/3892062 to your computer and use it in GitHub Desktop.
Save mribica/3892062 to your computer and use it in GitHub Desktop.
Install pg 9.1 (Ubuntu 12.04)

Install pg server

sudo apt-get install postgresql

Install client

sudo apt-get install pgadmin3

Install dev tools

sudo apt-get install libpq-dev

Basic Setup

To start off, we need to change the PostgreSQL pg user password; we will not be able to access the server otherwise

sudo su
root# passwd postgres

sudo -u postgres psql postgres
\password postgres
# enter password and confirm
# ctrl + d to exit pg prompt

Add new user

sudo -u postgres createuser --superuser new_user
sudo -u postgres psql postgres
postgres-# \password new_user
Enter new password: 
Enter it again: 

# Edit sudo vim /etc/postgresql/9.1/main/pg_hba.conf
# "local" is for Unix domain socket connections only
local   all         all                               md5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment