1. intall Postgresql 9.1 on centos
#yum install postgresql postgresql-server
2. Start Postgresql
# chkconfig postgresql on
# service postgresql start
3. Add a Linux user called greenuser
# adduser greenuser
# passwd greenuser
4. Connect to postgresql server
# su - postgres
5. Connect using psql command line tool:
# psql -d template1 -U postgres
6. Add a user called greenuser to postgresql
template1=#CREATE USER greenuser WITH PASSWORD 'greenPassword';
7. Change password for an user
template1=#ALTER USER greenuser WITH PASSWORD 'newGreenPassword';
8. Add a database called greenland
template1=#CREATE DATABASE greenland;
9. grant all privileges on database
template1=#GRANT ALL PRIVILEGES ON DATABASE greenland to greenuser;
10. quit postgresql
template1=#\q
11. access greenland database with greenuser user login
# su - greenuser
# psql -d greenland -U greenuser
12. drop database
# drop database [database_name]