Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: clarify config section, added ipv6 config for windows installs

...

  1. sudo apt-get install postgresql postgresql-client postgresql-contrib (This installs the database server/client, some extra utility scripts)
  2. sudo apt-get install pgadmin3 (This installs the pgAdmin GUI application for working with the database)
  3. References
    1. https://help.ubuntu.com/community/PostgreSQL
    2. http://hocuspokus.net/2007/11/install-postgresql-on-ubuntu-710

2. Configuration

  1. To activate all the local accesses allow localhost connections to all databases from any user without password authentication
    1. local all all trust  (unix installs only) 
    2. host all 127.0.0.1/32 trust
    3. host all all ::1/128 trust (windows only - ipv6 section
  2. Comment IDENT-based authentication
    1. Otherwise, the following error message will be popped up: "psql: FATAL:  Ident authentication failed for user "[userid]" "

...

4. Commands

  1. Server management
    1. sudo /etc/init.d/postgresql-8.3 stop
    2. sudo /etc/init.d/postgresql-8.3 start
    3. sudo /etc/init.d/postgresql-8.3 restart
  2. Connect to a database
    1. psql -U postgres template1
  3. Create user
    1. Login using postgres
    2. Run SQL: create user [userid] WITH CREATEDB;
  4. Create database
    1. Login with [userid]: psql -U [userid] template1
    2. Run SQL: create database [db1]
  5.