Running Postgres for development on Oneiric
Created 2011-10-18T03:27:36.976Z, last edited 2011-10-18T03:31:17.972Z
These are some notes for running Oneiric on a development machine.
Upgrading from Natty
Make sure all old Postgres installations are purged:
sudo apt-get purge postgresql postgresql-8.4
Getting Postgres 9.1 up and running
Install postgres:
sudo apt-get install postgresql
Only on a development machine
Turning off the fsync option will make Postgres run faster as it won't insist that all database changes are written to disk. Clearly do not do this if you care about the data you are writing to Postgres. This shouldn't be a problem on any development machine as they're all test databases.
Edit the server configuration:
sudo nano /etc/postgres/9.1/main/postgresql.conf
Change:
fsync = off
Then:
sudo service postgresql restart
Configure your ident authentication
Making proper use of ident authentication means that you can access Postgres without needing to use a password. Many of our Postgres set up scripts for projects assume that you have ident configured as a Postgres superuser.
Run psql as the postgres user to add in your configuration:
sudo -u postgres psql
And now we need to configure ident authentication — my user name is kirit, change to whatever you log in to Ubuntu as:
create role kirit login superuser; create database kirit with owner=kirit;
Exit psql and try again with your own account:
psql
You should now be able to see the postgres prompt again.
I have a Django user that I use across projects:
create role "Django" login superuser password 'django';
From here you can set up the databases or add other roles that you need normally.
© 2002-2025 Kirit & Tai Sælensminde. All forum posts are copyright their respective authors.
Licensed under a Creative Commons License. Non-commercial use is fine so long as you provide attribution.