1: Download the pgsql source code. The latest version is 9.3 beta.
Changes the Mkvcbuild.pm:64 the determine_version_xxx to 9.0 for visual 2008.
3: Running the command “perl build.pl DEBUG”, fist of all, install perl and flex and bison. then set the them to system path environment variable. E:\postgresql-9.3beta1\src\tools\msvc
4: The flex and bison are used to generate the “xxx.c” when compiling the project.
5: The most important thing is to set the msbuild.exe which is a executable file in .net frame properly.
6: Running the command “perl build.pl DEBUG” again, as well as, it will generate all files needed.
7: Opening the VS to open the solution files.
8: Running the command “perl install.pl target_directory”. the target_directory will store all binary files.
9: Setting the “postgres” as startup project, and sets the project properties: command to “target_bin_dir” , argument to “-D DatabaseName”, working directory to “target_bin_dir”.