http://www.postgresql.org/docs/9.1/static/index.html
https://help.ubuntu.com/community/PostgreSQL
http://www.stuartellis.eu/articles/postgresql-setup/#install-admin-deb
Server:
This installs the server with the "Server Instrumentation", which adds some function on server and is needed by the GUI admin pgAdmin III.
apt-get install postgresql postgresql-contrib
For ""Postgresql 8.4"", run the adminpack.sql script, simply type:
sudo -u postgres psql < /usr/share/postgresql/8.4/contrib/adminpack.sql
For ""Postgresql 9.1""+ install the adminpack "extension":
sudo -u postgres psql
CREATE EXTENSION adminpack;
Client: apt-get install postgresql-client
sudo -u postgres psql postgres
under psql prompt:
\password postgres
sudo apt-get install pgadmin3
psql -h server.domain.org database user
Create Database
sudo -u postgres createdb mydb