记录一下昨天配置postgresql8.0的经过:
1. Add an apt soucelist :
deb http://sebastien.lardiere.free.fr/ ./postgresql8-i386/
2. Install the postgres 8.0
$apt-get update
$apt-get install postgresql-8.0
3. Now u can connect to postgres using:(template1 is the database name, postgres is the username)
sudo su postgres psql template1
4. Add a user of ur own:(-W means prompt for password to connect)
$sudo su postgres
$createuser username -W
(decide whether this user can add new user and create database by input y/n to the questions)
$exit
5. Now u can login with ur newly created username and password using:
$psql -U username -h localhost -d dbname
(then u should input the password that u set when u created this user)
6. Configuration File:
/etc/postgresql/8.0/main/pg_hba.conf
7. Postgres commands:
\h --help with SQL commands
\? --help with psql commands
\q --quit
\c dbname --connect to new database
\d{t|i|s|v|S} --list tables/indexes/sequences/views/system tables (add "+" for more detail)
\du --list users
\l --list all databases(add "+" for more detail)