Postgresql source code structure analysis

 


Table of contents

foreword

Source code download

source code structure

core code directory

end


foreword

This article introduces the postgresql source code directory structure and the core code directory. Friends who are interested in the pg kernel should pay attention to the content of this column.


Source code download

The source package can be downloaded from the official website below

PostgreSQL: File Browser

You can also find the postgres source code warehouse on github/gitee/gitcode and clone it locally, so that you can continuously update to the latest code modification.

github is not very stable, the following is the mirror warehouse of gitcode of csdn

mirrors / postgres / postgres · GitCode

source code structure

The structure of the root directory of the postgres source code is as follows

[senllang@localhost postgres]$ ll

total 1180

-rw-r--r--. 1 obvious develops 490 Feb 9 2021 aclocal.m4

drwxr-xr-x.  2 senllang develops   4096 Feb  9  2021 config

-rw-r--r--.  1 senllang develops 427787 Apr 21 19:29 config.log

-rwxr-xr-x. 1 only develops 39999 Apr 21 19:29 config.status

-rwxr-xr-x.  1 senllang develops 568656 Feb  9  2021 configure

-rw-r--r--. 1 transparent develops 82388 Feb 9 2021 configure.in

drwxr-xr-x. 57 clear develops 4096 Feb 9 2021 contrib

-rw-r--r--. 1 obvious develops 1192 Feb 9 2021 COPYRIGHT

drwxr-xr-x.  3 senllang develops     87 Feb  9  2021 doc

-rw-r--r--.  1 senllang develops   4278 Apr 21 19:29 GNUmakefile

-rw-r--r--. 1 obvious develops 4278 Feb 9 2021 GNUmakefile.in

-rw-r--r--. 1 obviously develops 277 Feb 9 2021 HISTORY

-rw-r--r--. 1 clear develops 1665 Feb 9 2021 Makefile

-rw-r--r--.  1 senllang develops   1213 Feb  9  2021 README

-rw-r--r--. 1 clear develops 721 Feb 9 2021 README.git

drwxr-xr-x. 16 clear develops 4096 Apr 21 19:29 src

Main Directory Description

doc

        Document directory, which can compile hand-deleted documents in pdf and html formats

contrib        

Plug-in source code directory, not included in the kernel code, the plug-in is loaded by create extension when it is used

src

The source code directory of the postgres database

core code directory

Let's look at the directory structure under src, which contains the code of the postgresql kernel.

drwxr-xr-x. 28 senllang develops  4096 Feb  9  2021 backend

drwxr-xr-x. 21 develops 4096 Feb 9 2021 bin

drwxr-xr-x. 3 obvious develops 4096 Feb 9 2021 common

-rw-r--r--.  1 senllang develops   173 Feb  9  2021 DEVELOPERS

drwxr-xr-x. 2 obvious develops 4096 Feb 9 2021 fe_utils

drwxr-xr-x. 31 senllang develops  4096 Apr 21 19:29 include

drwxr-xr-x.  4 senllang develops    47 Feb  9  2021 interfaces

-rw-r--r--. 1 clear develops 1842 Feb 9 2021 Makefile

-rw-r--r--. 1 obvious develops 34174 Apr 21 19:29 Makefile.global

-rw-r--r--. 1 obvious develops 34512 Feb 9 2021 Makefile.global.in

lrwxrwxrwx.  1 senllang develops    31 Apr 21 19:29 Makefile.port -> ../src/makefiles/Makefile.linux

drwxr-xr-x.  2 senllang develops  4096 Feb  9  2021 makefiles

-rw-r--r--.  1 senllang develops 15338 Feb  9  2021 Makefile.shlib

-rw-r--r--. 1 senllang develops 6392 Feb 9 2021 nls-global.mk

drwxr-xr-x. 6 clear develops 78 Feb 9 2021 pl

drwxr-xr-x.  2 senllang develops  4096 Feb  9  2021 port

drwxr-xr-x. 2 obvious develops 142 Feb 9 2021 template

drwxr-xr-x. 16 senllang develops  4096 Feb  9  2021 test

drwxr-xr-x. 4 obvious develops 4096 Feb 9 2021 timezone

drwxr-xr-x. 10 senllang develops  4096 Feb  9  2021 tools

drwxr-xr-x. 2 senllang develops 4096 Feb 9 2021 tutorial

Main catalog introduction:

backend

Database server source code

bin

Client and server tool code

common

General algorithm source code, such as md5, sha2, json, base64, etc.

fe_utils

Client common structure and processing

include

Header directory

interfaces

Provided libpq, ecpg and other development interface libraries

pl

Process language interface and syntax processing, such as plpgsql, plperl, plpython and other development interfaces

port

libpgport public library

template

Provide compilation parameters under different compilation platforms

test

Test program, start the test through make check

timezone

Time zone related public interface

tools

Suggestions or configurations for the use of tools, such as compiling under win, ci, editor, and valgrind, etc.

tutorial

Basic SQL and step routines using postgresql

Finally, thank you for browsing!


end

Author email: [email protected]
If there are any mistakes or omissions, please point them out and learn from each other. If you want to know anything, welcome to leave a message or send an email. Your attention is the biggest motivation for me to continue sharing.

Note: Do not reprint without consent!

Guess you like

Origin blog.csdn.net/senllang/article/details/130303467
Recommended