The main functions of the PostgreSQL database system are focused on the Postgres program, whose entry is the main function in the main module, where the data set cluster is initialized and the database server is started. Main module mainly work when determine the current operating system platform, and accordingly do some platform-related environment variable setting and initialization, and then through the command line parameters, the control to the corresponding module. is the invocation flow of the main function.
The process of main function main of PostgreSQL system
The PostgreSQL daemon postmaster assigns the background Postgres service process to the user connection request and also initiates the associated background service process: Syslogger (syslog process), Pgstat (Statistics data collection process),
Autovacuum (System automatic cleanup process). When postmaster enters the loop listener, it starts as follows: Bgwriter (background write process), Walwriter (pre-write log write process), Pgarch (pre-write log archive process). These processes are described in a subsequent article.
Is the background flowchart for PostgreSQL: