Posts

Showing posts with the label ubuntu

Install postgresql 9.1 on Ubuntu 12.04

Another install guide - maybe not super friendly, but it worked. 1) Install $ sudo apt-get update $ sudo apt-get install postgresql-9.1 Verify it works $ sudo invoke-rc.d postgresql status 2) Set password Now you need to set a password for the postgres database role: sudo -u postgres psql postgres \password postgres 3) Install the contrib (contains ssl, text stuff and required stuff used by pgadmin) Read more?: http://packages.debian.org/wheezy/postgresql-contrib-9.1 $ sudo apt-get install postgresql postgresql-contrib $ sudo -u postgres psql postgres=# CREATE EXTENSION adminpack; CREATE EXTENSION Verify that it was installed: select * from pg_extension; 3) Optionally restart database server? sudo /etc/init.d/postgresql restart 4) Create databases Now create a database postgres=# CREATE DATABASE mytestdb; postgres=# \c mytestdb mytestdb=# CREATE TABLE monkeytest (abe int); Display the tables mytestdb=# \d Insert a row mytestdb=# INSERT IN...

Installing postgresql 9.1 on Ubuntu 11.10

Image
Ok, so my first blog entry will be about how I recently installed postgresql 9.1 on Ubuntu 11.10 and some links. I couldn't get apt-get install to work, so I had to download a deb file and install it myself. Here are the steps: Verify that it has started: In order to talk with postgresql you can run this (then you don't have to modify PATH): To load this postgres into your environment, source the env file (if you don't run this you will get errors like stuff you need to install): Now you can try: Try to create a database (will ask for postgres password). Backup and restore that worked: Backup: http://www.commandprompt.com/blogs/joshua_drake/2010/07/a_better_backup_with_postgresql_using_pg_dump/ References: http://wiki.openscg.com/index.php/Postgres_9.1_DEB http://library.linode.com/databases/postgresql/ubuntu-10.10-maverick http://www.commandprompt.com/blogs/joshua_drake/2010/07/a_better_backup_with_postgresql_using_...