Recently in the consideration of database selection, consider the late transfer of data to PostgreSQL, PostgreSQL source code is implemented with C, it is refined and perfect, it is worth learning
First go to pgsql official website to download the latest source code, and then also need to Perl,bison
Install Activerperl-5.22.1.2201x64.msi By default on the C drive, all the way to next installation.
I was installing Perl on the C drive, and I added Perl's C-Drive path location to the system environment variable.
Open the postgresql9.5.2 folder, locate the mkvcbuild.pm file (as shown), open it with a text editor, modify the line where my $vsVersion = Determinevisualstudioversion (), change to my $ Vsversion = "12.0.0", VS2013 corresponding version is 12.0
Anti-key editing
Open cmd or open with vs2013 x64 cmd command tool, switch to source MSVC directory
Msvc directory, enter perl build.pl DEBUG and start compiling code, it takes 5-6 minutes, speed according to the computer configuration to set
After generating the source code, the last
Then continue to enter the perl install.pl pathin the command editor, for example:
Perl install.pl D:\pgbin
Post-build effects
Here is the key if you do not have the following operations you need to go to the source code to remove the administrator's right to judge, if you run with the Super administrator will error
We add a postgres user with the cmd command
NET user Postgres Postgres/add
Open Run input runas/user:postgres cmd.exe
CMD is opened with Postgres permission
Let's start with cmd, initialize database db directly.
Postgres.exe-d DB Here you start a server instance and start listening to all the links
Enter postgres.exe-d db (Note D in-D must capitalize), this is not necessarily DB, you can also set your own
The database I used here Pgsql
Here Pgsql server is starting up well.
And then we'll use Navcat to connect and try and build a database.
Open the source project, it will take a few minutes to load
BACKEND\EXECUTOR\EXECMAIN.C, hit the breakpoint in turn
Finally we open the Psql source, open pquery.c, inside set a good breakpoint
Start debugging, enter the breakpoint.
It's a little late today, and then there's time to share the learning of the source structure.
Description of the source code has a dedicated website http://doxygen.postgresql.org/
Next you can start PostgreSQL source learning journey, you can build tables through NAVCAT, delete the table, insert data, update, a variety of operations, indulge in the abuse of Pgsql source. Hope this article can give you learn pgsql some help, this database is really excellent, if you go to use there will be a brief encounter feeling
Debug postgresql9.5.2 Latest Source