pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: process startup: Split single user code out of PostgresMain().
Date: Sat, 18 Sep 2021 02:59:54 +0000
Message-ID: <E1mRQa2-0000Dd-WB@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7c83a3bf51489e5b48c567c2ac54fed030d23c52

Modified Files
--------------
src/backend/main/main.c             |   5 +-
src/backend/postmaster/postmaster.c |   8 +-
src/backend/tcop/postgres.c         | 152 ++++++++++++++++++++----------------
src/include/tcop/tcopprot.h         |   5 +-
4 files changed, 90 insertions(+), 80 deletions(-)



Message-ID: <E1mRQa2-0000Dd-WB@gemulon.postgresql.org>
Permalink:  ../E1mRQa2-0000Dd-WB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mRQa2-0000Dd-WB@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: process startup: Split single user code out of PostgresMain().
  In-Reply-To: <E1mRQa2-0000Dd-WB@gemulon.postgresql.org>
  References: <E1mRQa2-0000Dd-WB@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox