process startup: Split single user code out of PostgresMain().
authorAndres Freund <[email protected]>
Wed, 8 Sep 2021 19:19:50 +0000 (12:19 -0700)
committerAndres Freund <[email protected]>
Sat, 18 Sep 2021 02:56:47 +0000 (19:56 -0700)
commit7c83a3bf51489e5b48c567c2ac54fed030d23c52
tree5d85bd3cb84626ad497bc54acf378d4acf2af4bf
parent499c9b1266395c5e4c22bd7b2cbdb7f5a64ea4fa
process startup: Split single user code out of PostgresMain().

It was harder than necessary to understand PostgresMain() because the code for
a normal backend was interspersed with single-user mode specific code. Split
most of the single-user mode code into its own function
PostgresSingleUserMain(), that does all the necessary setup for single-user
mode, and then hands off after that to PostgresMain().

There still is some single-user mode code in InitPostgres(), and it'd likely
be worth moving at least some of it out. But that's for later.

Reviewed-By: Kyotaro Horiguchi <[email protected]>
Author: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/20210802164124[email protected]
src/backend/main/main.c
src/backend/postmaster/postmaster.c
src/backend/tcop/postgres.c
src/include/tcop/tcopprot.h