Postgresql's .gz package can be downloaded from csdn. PostgreSQL's official website does not seem to be available.
Decompress the package and enter its folder. Then, run the following command:
./Configure
The system may not find two packages. install them first:
Sudo apt-GST install libreadline5-dev
Sudo apt-GST install zlib1g-dev
Then execute
Sudo make
Sudo make install
In this way, PostgreSQL will be installed in the/usr/local/pgsql folder by default.
Add a data folder under the/usr/local/pgsal Folder:
Sudo mkdir/usr/lcoal/pgsql/Data
To use PostgreSQL, you need to add a new user. The username is random. I use Postgres:
Sudo useradd posrgres
Sudo passwd ipvs
Set the file master in the data folder to ipvs.
Sudo chown Postgres/usr/local/pgsql/Data
Start posggresql:
Su ipvs
/Usr/local/pgsql/bin/initdb-D/usr/local/pgsql/Data
/Usr/local/pgsql/bin/pg_ctl start-D/usr/local/pgsql/Data
Create:
/Usr/local/pgsql/bin/createdb test-u Postgres
/Usr/local/pgsql/bin/Psql test-u Postgres
Reference: http://hi.baidu.com/wp_sky_city/blog/item/1875f022d2211a58ac34ded8.html