1 Download the ZIP file from http://www.enterprisedb.com/products-services-training/pgbindownload
2 Unzip the archive into a directory of your choice (the archive is created such that unzipping it, it will create a directory pgsql with everything else below that)
3 Run initdb (this can be found in the subdirectory pgsql\bin)
initdb -D c:\Users\Arhtur\pgdata -U postgres -W -E UTF8 -A md5
This will create the postgres “data directory” (aka the “cluster”) in c:\Users\Arhtur\pgdata. You need to make sure that the user running this command has full read/write privileges on that directory.
-U postgres creates the superuser as postgres, -W will prompt you for the password of the superuser, -E UTF8 will create the database with UTF-8 encoding and -A md5 enables the password authentication.
4 To start Postgres, run:
pg_ctl -D c:\Users\Arhtur\pgdata start
this has(!) to be done as the user who ran initdb to avoid any problems with the access to the data directory.
5 To shutdown Postgres, run:
pg_ctl -D c:\Users\Arhtur\pgdata stop
6 psql.exe (the command line client) and pgAdmin3.exe are both located in the bin directory
链接
https://wiki.postgresql.org/wiki/9.1%E5%8F%82%E8%80%833
http://blog.csdn.net/huguangshanse00/article/details/8520998