su cd /usr/local/src wget http://ftp.postgresql.org/pub/source/v9.2.2/postgresql-9.2.2.tar.gz
mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data adduser postgres chown -R postgres:postgres /usr/local/pgsql
su postgres cd $HOME vi .bash_profile PGDATA=/usr/local/pgsql/data PGLIB=/usr/local/pgsql/lib MANPATH=$MANPATH:/usr/local/pgsql/man PATH=$PATH:/usr/local/pgsql/bin export PGDATA PGLIB MANPATH PATH
/etc/init.d/postgresql start su - postgres initdb -D /usr/local/pgsql/data postgres -D /usr/local/pgsql/data >logfile 2>&1 createdb test psql test mydb=# select current_date;