Posts

Showing posts with the label postgresql

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...

Postgresql on OSX and Windows (using VMware fusion)

NB! I decided not to use this setup after all. I had different problems with postgres, authentication and lion. I am not sure why this happened. I decided to still publish this in case anyone finds it (or parts of it) useful. Now I setup a port forward to a Linode VPS with Bitvise Tunnelier  which is free for non-commercial use. Original post: -------------------------------------------------------------------------------------------------------------------------------- I wanted to setup a postgresql server on my mac os x, but also share it with my virtual Windows machine. Whenever I want to code in C# I use Visual Studio on Windows, and since I run Postgres on Linux i wanted a "similar setup" on my development machine. To do this you need to have OS X installed with VMware Fusion and a virtual machine with Windows. The following 3 steps will be performed. 1. Verifying setup 2. We install postgresql on Mac os x 3. We configure VMware to use a static Ip-Address, to ...

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_...