...
- sudo apt-get install postgresql postgresql-client postgresql-contrib (This installs the database server/client, some extra utility scripts)
- sudo apt-get install pgadmin3 (This installs the pgAdmin GUI application for working with the database)
- References
2. Configuration
- To activate all the local accesses allow localhost connections to all databases from any user without password authentication
- local all all trust (unix installs only)
- host all 127.0.0.1/32 trust
- host all all ::1/128 trust (windows only - ipv6 section)
- Comment IDENT-based authentication
- Otherwise, the following error message will be popped up: "psql: FATAL: Ident authentication failed for user "[userid]" "
...
4. Commands
- Server management
- sudo /etc/init.d/postgresql-8.3 stop
- sudo /etc/init.d/postgresql-8.3 start
- sudo /etc/init.d/postgresql-8.3 restart
- Connect to a database
- psql -U postgres template1
- Create user
- Login using postgres
- Run SQL: create user [userid] WITH CREATEDB;
- Create database
- Login with [userid]: psql -U [userid] template1
- Run SQL: create database [db1]