{Installare i pacchetti postgresql postgresql-client postgresql-contrib
shell di postgress:
su postgres psql postgres
(in ubuntu: sudo -u postgres psql postgres)

#creare super utente (da valutare)
postgres= create user root with superuser login;

#creare utente
postgres= create user sqlgrey with password 'iehQ6Ffshvta93eP';

#creare database
postgres= create database sqlgrey owner sqlgrey;
eventualmente per settare encoding diverso (default è UTF-8) usare\\
ENCODING = encoding (ad esempio 'ISO8859-1')

#creare schema
postgres= create schema nomeschema;

#abilitare connessioni in entrata
sudo edit /etc/postgresql/8.3/main/postgresql.conf
listen_addresses = '*' 
password_encryption = on

#editare /etc/postgresql/8.3/main/pg_hba.conf (client authentication)
# TYPE     DATABASE  USER    CIDR-ADDRESS          METHOD
local      database  user  auth-method  [auth-option]
host       database  user  CIDR-address  auth-method  [auth-option]
hostssl    database  user  CIDR-address  auth-method  [auth-option]
hostnossl  database  user  CIDR-address  auth-method  [auth-option]
host       database  user  IP-address  IP-mask  auth-method  [auth-option]
hostssl    database  user  IP-address  IP-mask  auth-method  [auth-option]
hostnossl  database  user  IP-address  IP-mask  auth-method  [auth-option]

#auth-method
trust 		accetta connessioni senza pwd
reject 		non accetta connessioni
md5 		MD5-encrypted password for authentication
password 	pwd scambiata in chiaro
krb5 		usa kerberos 5 per autenticare il client
ident		ottiene il nome utente del sistema operativo dal client e controla se è abilitato alla 			connessione 
ldap 		autentica usando server LDAP
pam		Pluggable Authentication Modules
}
}}}
!!Comandi base
settare uno schema(TUOSCHEMA):
%%prettify 
{{{
SET search_path TO TUOSCHEMA,public;
}}}
Connettere a DB:
%%prettify 
{{{
psql -U nomeutente nomedb
}}}
Fare dump di intero sistema:
%%prettify 
{{{
pg_dumpall > allDb.sql
}}}

! Configurazioni
#editare /etc/postgresql/8.3/main/pg_hba.conf ed aggiungere le proprie regole 
%%prettify 
{{{
ad esempio per accesso tuo utente:
local   all         dbuser                            trust
da che rete:
host    all         all         192.168.0.0/24        trust
}}}