diff options
| author | Andres Freund | 2021-09-08 19:19:50 +0000 |
|---|---|---|
| committer | Andres Freund | 2021-09-18 02:56:47 +0000 |
| commit | 7c83a3bf51489e5b48c567c2ac54fed030d23c52 (patch) | |
| tree | 5d85bd3cb84626ad497bc54acf378d4acf2af4bf /src/include/tcop | |
| parent | 499c9b1266395c5e4c22bd7b2cbdb7f5a64ea4fa (diff) | |
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 <horikyota.ntt@gmail.com>
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20210802164124.ufo5buo4apl6yuvs@alap3.anarazel.de
Diffstat (limited to 'src/include/tcop')
| -rw-r--r-- | src/include/tcop/tcopprot.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 968345404e..5c77075aed 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -75,8 +75,9 @@ extern void ProcessClientWriteInterrupt(bool blocked); extern void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname); -extern void PostgresMain(int argc, char *argv[], - const char *dbname, +extern void PostgresSingleUserMain(int argc, char *argv[], + const char *username) pg_attribute_noreturn(); +extern void PostgresMain(const char *dbname, const char *username) pg_attribute_noreturn(); extern long get_stack_depth_rlimit(void); extern void ResetUsage(void); |
